Skip to content

Instantly share code, notes, and snippets.

View snicol's full-sized avatar

Scott Nicol snicol

View GitHub Profile
@snicol
snicol / Program.cs
Created November 8, 2010 20:42
A C# calculator.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Calculator
{
class Program
{
static void Main(string[] args)
@snicol
snicol / Oxygen File Creater
Created November 9, 2010 16:22
Creates files for MVC and helper, and also the classes for all of them.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace Oxygen
{
@snicol
snicol / irc.rb
Created January 1, 2011 15:48
Ruby IRC Client. Very basic. No support for IRC commands, yet... Will expand into a full repo/app.
require 'socket'
include Socket::Constants
class Client
def initialize(settings, channel)
@settings = settings
@channel = channel
@connection = TCPSocket.open(@settings['server'], @settings['port'])
@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()
@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
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 / 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'
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(, , , , , )
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!";
@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