Skip to content

Instantly share code, notes, and snippets.

@drewolson
drewolson / reflection.go
Last active November 20, 2023 09:39
Golang Reflection Example
package main
import (
"fmt"
"reflect"
)
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`
@dataolle
dataolle / sendxbmc.sh
Created December 4, 2012 18:50
send url to xbmc's json-rpc service for playback on the big screen
#!/bin/bash
#set url and port to the xbmc box webservice
XBMC_HOST="http://127.0.0.1:8080"
if [ "$1" = "" ]; then
echo -n "Insert URL: "
read url
else
url="$1"
fi
@mmdemirbas
mmdemirbas / LogFile.udl.xml
Created September 13, 2012 11:34
Custom log file syntax highlighting for Notepad++
<NotepadPlus>
<UserLang name="LogFile" ext="log">
<Settings>
<Global caseIgnored="yes" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">[(0])0</Keywords>
<Keywords name="Folder+"></Keywords>
@olivierlacan
olivierlacan / git_log.md
Created August 2, 2012 15:06
My git log custom output aliases
git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
git config --global alias.lol "log --graph --decorate --pretty=oneline --abbrev-commit --all"
git config --global alias.mylog "log --pretty=format:'%h %s [%an]' --graph"

To check that they've been added correctly, first run git config --list. You should see something like this in the midst of all your other configuration:

alias.hist=log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short
@briandealwis
briandealwis / gist:782862
Created January 17, 2011 13:55 — forked from spullara/gist:782523
One-liner to turn jar with Main-Class into executable shell script
# turn a jar with a Main-Class into a stand alone executable
(echo '#!/usr/bin/env java -jar'; cat blahblah.jar) > blah
# turn a jar with a particular main clas into a stand alone executable
(echo '#!/usr/bin/env java -jar package.MainClass'; cat blahblah.jar) > blah