Skip to content

Instantly share code, notes, and snippets.

View nanotaboada's full-sized avatar
🏠
Working from home

Nano Taboada nanotaboada

🏠
Working from home
View GitHub Profile
@nanotaboada
nanotaboada / Book.cs
Last active September 24, 2015 01:07
Serializable Book class with Catalog collection
/// <summary>
/// This is the Book class, it represents a book.
/// </summary>
[DataContract, Serializable, XmlRoot("book")]
public class Book
{
#region Properties
[DataMember, XmlAttribute("isbn")]
public string Isbn { get; set; }
[DataMember, XmlAttribute("title")]
@nanotaboada
nanotaboada / dbconfig.xml
Last active September 25, 2015 21:38
Idea for ADO.NET connection string serialization
<conf
host="localhost"
init="northwind"
auth="false"
user="foo"
pass="bar"
file="northwind.mdf"
/>
@nanotaboada
nanotaboada / Book.cs
Last active November 11, 2023 19:46
A Plain Old CLR Object (POCO) model of a Book with DataAnnotations for validation
using System;
using System.ComponentModel.DataAnnotations;
namespace NanoTaboada.GitHub.Gist
{
public class Book
{
[Key]
public string Isbn { get; set; }
@nanotaboada
nanotaboada / backup.sh
Created December 2, 2012 04:45
Really simple bash backup script
#!/bin/bash
if [ -e 'filelist' ]
then
files=`cat filelist`
for file in $files
do
if [ -e $file ]
then
tar czf backup.tar.gz $file
@nanotaboada
nanotaboada / books.json
Last active August 14, 2024 07:50
A small-sized (8 items) sample collection of free Books in valid JSON (RFC 8259) format
{
"books":[
{
"isbn":"9781593279509",
"title":"Eloquent JavaScript, Third Edition",
"subtitle":"A Modern Introduction to Programming",
"author":"Marijn Haverbeke",
"published":"2018-12-04T00:00:00.000Z",
"publisher":"No Starch Press",
"pages":472,
@nanotaboada
nanotaboada / commit-msg
Last active May 10, 2017 18:37
Git commit-msg hook that prevents committing with a comment that does not include a Jira key
#!/bin/sh
# ---------------------------------------------------------------------------- #
# Filename: .git/hooks/commit-msg #
# Description: Git commit-msg hook that prevents committing with a comment #
# that does not include a Jira key. #
# Created by: Nano Taboada <[email protected]> #
# Version: 0.1.0 #
# License: http://opensource.org/licenses/MIT #
# Last updated: Jun 30, 2015 #
@nanotaboada
nanotaboada / pre-commit
Last active February 27, 2021 18:55
Git pre-commit hook that prevents committing when the autor name is unknown, null, empty or whitespace
#!/bin/sh
# ---------------------------------------------------------------------------- #
# Filename: .git/hooks/pre-commit #
# Description: Git pre-commit hook that prevents committing when the autor #
# name is unknown, null, empty or whitespace. #
# Created by: Nano Taboada <[email protected]> #
# Version: 0.1.0 #
# License: http://opensource.org/licenses/MIT #
# Last updated: Jun 30, 2015 #
@nanotaboada
nanotaboada / pre-push
Last active August 15, 2021 19:38
Git pre-push hook that prevents pushing directly to master branch
#!/bin/sh
# ---------------------------------------------------------------------------- #
# Filename: .git/hooks/pre-push #
# Description: Git pre-push hook that prevents pushing directly to master #
# branch #
# Created by: Nano Taboada <[email protected]> #
# Version: 0.1.0 #
# License: http://opensource.org/licenses/MIT #
# Last updated: Jun 30, 2015 #
@nanotaboada
nanotaboada / book.ts
Created May 10, 2017 18:49
A TypeScript class for a Book
export class Book {
constructor(
public isbn: string,
public title: string,
public subtitle: string,
public author: string,
public publisher: string,
public published: string,
public pages: number,
public description: string,
@nanotaboada
nanotaboada / Book.java
Last active November 11, 2023 19:46
JPA Entity Bean for a Book
import java.time.LocalDate;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Past;