Skip to content

Instantly share code, notes, and snippets.

View snicol's full-sized avatar

Scott Nicol snicol

View GitHub Profile

Keybase proof

I hereby claim:

  • I am snicol on github.
  • I am snicol (https://keybase.io/snicol) on keybase.
  • I have a public key ASBYSfviWjMQ-M-VH9PPtaDrhLOm5usGuvBVXCdeclnkyQo

To claim this, I am signing this object:

@snicol
snicol / games.md
Created January 31, 2018 12:27
Games I need to play, in some order...

PC

  • Witcher 3 (own)
  • Dark Souls 2 (own)
  • Inside + Limbo (own)

PS4

  • Horizon Zero Dawn
  • Uncharted (1-4)
package main
import (
"runtime"
"fmt"
)
type SystemStat struct {
Alloc uint64
TotalAlloc uint64
@snicol
snicol / happy_birthday.go
Last active August 4, 2017 14:03
Plays the Happy Birthday song via PCM using hajimehoshi's oto lib
package main
import (
"github.com/hajimehoshi/oto"
"log"
"math"
"strings"
)
const defaultNumChannels = 2
sudo mv /etc/php-fpm.d/www.conf /etc/php-fpm.d/www.conf.bak;
sudo yum remove -y php70w*;
sudo yum install -y php71w php71w-fpm php71w-opcache php71w-devel php71w-cli php71w-pdo php71w-pear php71w-mcrypt php71w-xml php71w-gd php71w-mbstring php71w-bcmath php71w-mysqlnd php71w-soap php71w-process php71w-pecl-redis php71w-pecl-imagick;
sudo rm -rf /etc/php-fpm.d/www.conf;
sudo mv /etc/php-fpm.d/www.conf.bak /etc/php-fpm.d/www.conf;
sudo service nginx restart && sudo service php-fpm restart;
echo "DONE MATEY!";
5 golang.org/x/crypto/ssh.(*Client).handleChannelOpens(, )
5 golang.org/x/crypto/ssh.(*Client).handleGlobalRequests(, )
5 golang.org/x/crypto/ssh.(*forwardList).handleChannels(, )
7 golang.org/x/crypto/ssh.(*handshakeTransport).kexLoop()
7 golang.org/x/crypto/ssh.(*handshakeTransport).readPacket(, , , , , )
@snicol
snicol / sidebar.sh
Created December 20, 2011 16:50
shell sidebar
# A activity monitor for weather, hd, ram and cpu. Cool using it as a tmux
# sidebar or something. Not great code, but fun to make! Change the
# weather function to whatever you need it.
#!/bin/sh
red='\e[0;31m'
RED='\e[1;31m'
blue='\e[0;34m'
BLUE='\e[1;34m'
cyan='\e[0;36m'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
PROMPT='%{$fg[cyan]%}[%m/%n]%{$fg[red]%}|%{$fg[green]%}[%2~]%{$reset_color%}%{$reset_color%}$(git_prompt_info)%{$fg[cyan]%}⇒%{$reset_color%} '
@snicol
snicol / Smeagol.fix
Created October 21, 2011 08:45
Fixes dependency issues for smeagol.
gem uninstall smeagol gollum sinatra rack
gem uninstall sinatra =v=1.3.3 # just to make sure
gem install sinatra -v=1.1.3 --no-ri --no-rdoc
gem install rack -v=1.2.4 --no-ri --no-rdoc
gem install smeagol --no-ri --no-rdoc
@snicol
snicol / shape.py
Created September 20, 2011 13:26
shape class
class Shape():
def __init__(self, sides, size):
self.sides = sides
self.size = size
def render(self):
if self.sides == 0:
circle(self.size)
else:
self.render_polygon()