Skip to content

Instantly share code, notes, and snippets.

View cormacrelf's full-sized avatar
🦀

Cormac Relf cormacrelf

🦀
View GitHub Profile
@cormacrelf
cormacrelf / Crack.rb
Created June 12, 2011 02:59
Ruby Vigenere Cipher cracker (password list)
class EnumLike
@server_Symb=[:a, :b, :c, :d, :e, :f, :g, :h, :i, :j, :k, :l, :m, :n, :o, :p, :q, :r, :s, :t, :u, :v, :w, :x, :y, :z]
@string_array=["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
def EnumLike.hash_of_symbols
server_Enum=Hash::new
i=1
@server_Symb.each{ |e| server_Enum[e]=i; i +=1}
return server_Enum
end
@cormacrelf
cormacrelf / Spacedust.tmTheme
Created June 12, 2011 04:43
Spacedust TextMate theme - hand-transferred from Xcode
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Spacedust</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@cormacrelf
cormacrelf / pwdpractise.rb
Created July 16, 2011 03:20
Ruby Password Practise
# Ruby Password Practise Utility
#!/usr/local/bin/ruby
require 'rubygems'
require 'highline/import'
$password = ask("Enter your password: ") { |q| q.echo = "*" }
puts "Now type your password and hit return."
$success = 0
def check(possible)
if possible == $password
@cormacrelf
cormacrelf / gist.txt
Created January 30, 2012 08:07
brew install -v tmux
==> Downloading http://sourceforge.net/projects/tmux/files/tmux/tmux-1.6/tmux-1.6.tar.gz
File already downloaded in /Users/cormac/Library/Caches/Homebrew
/usr/bin/tar xf /Users/cormac/Library/Caches/Homebrew/tmux-1.6.tar.gz
==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/tmux/1.6 --sysconfdir=/usr/local/etc
./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/tmux/1.6 --sysconfdir=/usr/local/etc
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... etc/install-sh -c -d
checking for gawk... no
checking for mawk... no
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by tmux configure 1.6, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/tmux/1.6 --sysconfdir=/usr/local/etc
## --------- ##
## Platform. ##
@cormacrelf
cormacrelf / keybindings.zsh
Created February 1, 2012 04:21
keybindings
bindkey -v
bindkey "^P" vi-up-line-or-history
bindkey "^N" vi-down-line-or-history
bindkey "^A" beginning-of-line
bindkey "^E" end-of-line
bindkey "^H" backward-delete-char
bindkey "^U" backward-kill-line
bindkey "^?" backward-delete-char
bindkey "^[[2~" beep
bindkey "^[[5~" vi-backward-blank-word
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<body>
<div align="center">
<font face="Arial, Helvetica, sans-serif" color="#003366" size="2">
<font size="2" face="Arial">
Put anything you want in here. Mr Bowen forgot a <noscript></noscript> tag. Even log people's credentials using an event listener on the form. ANYTHING. Then test using this preview or put it into the page source's real div. Go for it.
* Embed a rickroll video
* Tweet how crap this webpage is
* Insert an ad for ALT-LP developed by yours truly and JP
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script language="JavaScript" type="text/javascript">
<!--
// switch the protocol to "https:// to enforce a SSL connection
var protocol = "http://";
//var protocol = "https://";
@cormacrelf
cormacrelf / dates
Created February 25, 2012 12:11
You know those people who can tell you the weekday for any date? Here's how to practise that. Tip: 0 means Sunday through to 6 means Saturday when talking about "weekday codes". Grey Matters' guide might help you, too: http://gmmentalgym.blogspot.com.au/
#!/usr/bin/env ruby
require 'date'
require "highline/import"
begin
class Date
def pretty_string
months = [ nil,"January", "Febuary",
"March","April","May",
@cormacrelf
cormacrelf / prototypes.js
Created March 3, 2012 05:06
Prototypical inheritance
function Foo() {
this.meaningOfLife = 42;
this.hasOwnProperty = function() {
return false;
};
}
Foo.prototype = {
wat: function() {
return Array(16).join("wat" - 1) + " Batman!";