Skip to content

Instantly share code, notes, and snippets.

View gmemstr's full-sized avatar
🏳️‍🌈
Free hugs!

Gabriel Simmer gmemstr

🏳️‍🌈
Free hugs!
View GitHub Profile
@gmemstr
gmemstr / NewRouterFunction_Go.sublime-snippet
Created November 17, 2017 21:05
Useful Sublime snippets for Pogo development
<!-- Use this to create a new route handler function -->
<snippet>
<content><![CDATA[
func ${2}() common.Handler {
return func(rc *common.RouterContext, w http.ResponseWriter, r *http.Request) *common.HTTPError {
return nil
}
}
Using a linux flavor or etc.
Using: /mnt/c/Users/gabriel/Documents/Projects/rrpg-cmd
Engine: /mnt/c/Users/gabriel/Documents/Projects/rrpg-cmd/engine
Config: /mnt/c/Users/gabriel/Documents/Projects/rrpg-cmd/config
Mods: /mnt/c/Users/gabriel/Documents/Projects/rrpg-cmd/mod
[modloader] Preloading Functions (mod_aload.bash)...OK
Loading mod_cecho...OK
Loading mod_cfg...OK
Loading mod_Content-Parser...OK
Loading mod_dos2unix...ERR:WRONG_OS
@gmemstr
gmemstr / import.py
Last active November 8, 2017 04:42 — forked from marians/import.py
Migrating a Ghost blog database to Jekyll
# coding: utf8
"""
This script helps to import content from a Ghost blog database to Jekyll.
The database is expected to be running on a reachalbe MySQL host.
See the very end for DB configuration.
Quick Usage:
pip install -r requirements

Git Galaxy Stack Shift - Open Letter

The goal of this stack shift is to save money while still providing the same writing convienience to authors and performance/readability/etc. for readers. It is imperitive that the transition happens seamlessly, with no downtime for readers, and that all authors are familiar with the process of publishing. We currently operate at a 100% loss, managing our own servers running Ghost and Mail-in-a-box on DigitalOcean hardware.

Currently, there are two options I am actively considering. The first is a publication on Medium, a popular blogging platform. Publications are "a way to group stories together by many writers or by one writer around a common theme or topic" (via Medium). The interface of Medium is minimalistic and attractive, and is extremely easy to use with their rich(ish) text editor and social media logins. It's fairly performant, and supports several features for building communities, e.g following, claps (likes). However there are a few downides - primaril

Keybase proof

I hereby claim:

  • I am gmemstr on github.
  • I am gmemstr (https://keybase.io/gmemstr) on keybase.
  • I have a public key whose fingerprint is BA60 CCB5 719C 9B29 E485 69C9 6CFD 7BB4 6A50 2C2B

To claim this, I am signing this object:

+// Converts ajax POST to JavaScript object
+var BodyToObject = function(body) {
+ var res = new Object;
+ body = body.split("&"); // param1=X,param2=X
+ console.log(body);
+ for (var i = body.length - 1; i >= 0; i--) {
+ var vals = body[i].split("="); // param2,X,param1,X
+ for (var k = vals.length - 2; k >= 0; k--) {
+ res[vals[k]] = vals[k + 1] // *hopefully* {param1:X,param2:X}
+ }
/*
* Basic FizzBuzz excersize in Golang
*/
package main
import (
"fmt"
)

mc7.ggservers.com

mc20.ggservers.com

mc38.ggservers.com

mc47.ggservers.com

mc49.ggservers.com

server {
listen 80;
server_name hostname.com;
location / {
proxy_pass http://127.0.0.1:8080$request_uri;
proxy_set_header Host $host;
}
#
# Overwatch Competitive Rank Point Algorithm ^TM ^^Copyright ^^^etc.
# Written by Gabriel Simmer, December 2016
# Feel free to use this script in your own
# projects, just make sure to provide some attribution
# back to either this gist or my GitHub. <3
#
def Calculate(time, points, deaths, elims, wins, lost):