This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// some useful directives and snippets for angularJS 1.X applications |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// miscellanous configuration files for IDE and tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// miscellanous directives and helpers for applications using AngularJS 1.X with the semantic-ui framework |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[a4paper,11pt]{article} | |
%% Load additional packages and commands. | |
\usepackage{tabularx} | |
%~ paper and margins | |
\usepackage[tmargin=2.2cm,bmargin=2.2cm,lmargin=2cm,rmargin=2cm]{geometry} | |
\setlength{\parindent}{0pt} % no indent | |
\setlength{\parskip}{\baselineskip} % bare line between paragraphs | |
\setlength{\baselineskip}{2.5pt} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// see https://play.golang.org/p/6YD4YdvGLr | |
// for an example | |
import ( | |
"reflect" | |
"unicode" | |
"unicode/utf8" | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert an sql.Rows to a map | |
func SqlToMap(rows *sql.Rows) { | |
columns, err := rows.Columns() | |
scanArgs := make([]interface{}, len(columns)) | |
values := make([]interface{}, len(columns)) | |
results := make([]map[string]interface{}, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imoprt "encoding/json" | |
func printJson(in interface{}) { | |
b, _ := json.Marshal(in) | |
fmt.Println(string(b)) | |
} | |
func printJsonErr(in interface{}, err error) { | |
if (err != nil) { | |
fmt.Println(err) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# add headers at the top of files | |
# how to use: | |
# perl add-headers.pl <header file> files | |
# to add headers to cpp files recursively, use: | |
# perl add-headers.pl $(find . -name "*.cpp") | |
# beware: the script does not check if the file already contains headers ! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# add headers to .h, .cpp, .c and .ino files automatically. | |
# the script will first list the files missing headers, then | |
# prompt for confirmation. The modification is made inplace. | |
# | |
# usage: | |
# add-headers.py <header file> <root dir> | |
# | |
# The script will first read the header template in <header file>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io" | |
"net/http" | |
"os" | |
"strings" | |
) |
OlderNewer