This file contains hidden or 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
func Tag(s interface{}, name string) (reflect.StructTag, error) { | |
var tag reflect.StructTag | |
t := reflect.TypeOf(s) | |
// Prevent running on types other than struct | |
if t.Kind() != reflect.Struct { | |
return "", errors.New(fmt.Sprintf("%v is not a struct\n", t.Name())) | |
} | |
This file contains hidden or 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
// | |
// GameScene.swift | |
// Flappy Bird | |
// | |
// Created on 4/20/16. | |
// Copyright (c) 2016 Joseph Spurrier. All rights reserved. | |
// | |
import SpriteKit |
This file contains hidden or 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
// Source: https://gitlab.pro/googlesource/tools/blob/ae534bcb6ccdd13487d0491c2194d10ebcd30ff3/astutil/imports.go | |
// Source: https://golang.org/src/go/doc/example.go#L262 | |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"go/ast" | |
"go/parser" |
This file contains hidden or 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 ( | |
"log" | |
"time" | |
) | |
func main() { | |
log.Println("Started ticker") |
This file contains hidden or 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 ( | |
"encoding/json" | |
"flag" | |
"io" | |
"io/ioutil" | |
"log" | |
"os" | |
) |
This file contains hidden or 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 | |
/* | |
// Example | |
sci := ServerConnInfo{ | |
"127.0.0.1", | |
"22", | |
"ubuntu", | |
`key.pem`, | |
} |
This file contains hidden or 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 ( | |
"bufio" | |
"io/ioutil" | |
"os/signal" | |
//"syscall" | |
"fmt" | |
"log" | |
"os" |
This file contains hidden or 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 | |
/* | |
Run and it will create appmaster.exe which will create a new appworker.exe if it is shutdown. | |
Must delete appmaster.exe before each run. | |
Only tested on Windows. | |
Should build with: -ldflags -H windowsgui | |
*/ | |
import ( |
This file contains hidden or 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
// Source: https://gist.github.com/tdegrunt/045f6b3377f3f7ffa408 | |
// Example: replaceall.exe -find="cordove" -replace="gowebapp" -extension="*.go" -filename=true -write=false | |
package main | |
import ( | |
"flag" | |
"fmt" | |
"io/ioutil" |
This file contains hidden or 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
############################################################################### | |
# New Server - AWS | |
############################################################################### | |
# Update software | |
sudo apt-get update | |
sudo apt-get upgrade | |
# Install Apps | |
sudo apt-get install unzip |