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
require "bundler/capistrano" | |
require "capistrano-rbenv" | |
# Pre-compile assets | |
load 'deploy/assets' | |
set :application, "wattball" | |
set :repository, "[email protected]/USER/PROJECT" | |
set :branch, "master" |
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
!!! 5 | |
%html | |
%head | |
%title On It's Way | |
%link(rel="stylesheet" type = "text/css" href = "template.css") | |
%link(rel = "stylesheet" | |
type = "text/css" | |
href = "'http://fonts.googleapis.com/css?family=Roboto:700'") |
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
class Ability | |
include CanCan::Ability | |
def initialize(user) | |
alias_action :read, :create, :edit, :to => :modify | |
alias_action :read, :edit, :destroy, :to => :self_maintain | |
user ||= User.new | |
if user.team |
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
#!/usr/bin/env ruby | |
def is_palindrome?(num) | |
num == num.to_s.reverse.to_i | |
end | |
def is_square_of_palindrome?(num) | |
root = Math.sqrt(num) |
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
# Chinese Whispers | |
# | |
# author: Calum Gilchrist | |
# | |
# Experiment to distort a string based on the number of nodes between the | |
# sender and recipient | |
# | |
require 'raspell' | |
require 'optparse' |
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
#!/bin/bash | |
# | |
# Implementation of a Known Plaintext Attack | |
# | |
# Author: Calum Gilchrist | |
# email: [email protected] | |
tmp_file=temp-$RANDOM.txt | |
if [[ ! $# -eq 2 ]]; then |
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
#!/bin/bash | |
# Clear up log files for ZNC IRC Bouncer | |
# | |
# Author: Calum Gilchrist | |
ZNC_HOME="/home/homelinen/.znc/" | |
# Remove logs older than 30 days | |
find $ZNC_HOME -mtime +30 -type f -name "*.log" -exec rm -v {} + |
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
Generated from: http://www.smallmeans.com/notes/shell-history/ | |
git 2946 ############################################################ | |
vim 1148 ######################## | |
ssh 753 ################ | |
ack 528 ########### | |
cd 427 ######### | |
ls 338 ####### | |
aws 266 ###### | |
brew 189 #### | |
dig 186 #### |
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
#!/usr/bin/env python | |
from enum import Enum | |
from time import time | |
class Fruit(Enum): | |
bannana = (0, 1) | |
apple = (1, 1) |
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
$ ./bin/npme.js start | |
sh: 1: ./node_modules/.bin/ndm: not found | |
npmE is now running (curl http://localhost:8080). | |
$ ./node_modules/.bin/ndm | |
Deploy service daemons directly from npm packages | |
Usage: | |
ndm install ask user about environment variables and install service. | |
... |