Skip to content

Instantly share code, notes, and snippets.

View Spaceghost's full-sized avatar
👻
Building distributed and decentralized systems that run in the browser

Johnneylee Jack Rollins Spaceghost

👻
Building distributed and decentralized systems that run in the browser
View GitHub Profile
@Spaceghost
Spaceghost / Tumblr Theme
Created November 29, 2010 07:25
This is the tumblr theme I wrote for http://Johnneylee.tumblr.com/
<!-- Author: Johnneylee Jack Rollins; Email: [email protected]; -->
<html>
<head>
<title>{Title}{block:PostSummary} | {PostSummary}{/block:PostSummary}</title>
<link rel="shortcut icon" href="{Favicon}">
<link rel="alternate" type="application/rss+xml" href="/rss">
<link rel="stylesheet" href="http://hr1v.com/remote/black-tie/sIFR-screen.css" type="text/css" media="screen" />
<link rel="stylesheet" href="http://hr1v.com/remote/black-tie/sIFR-print.css" type="text/css" media="print" />
@Spaceghost
Spaceghost / Role.rb
Created December 25, 2010 17:24 — forked from joshrendek/Role.rb
class Role < ActiveRecord::Base
serialize :permissions
has_many :users
end
@Spaceghost
Spaceghost / .vimrc
Created December 28, 2010 22:44
Mah config section
set nocompatible " use vim defaults
set ls=2 " allways show status line
set tabstop=2 " numbers of spaces of tab character
set shiftwidth=2 " numbers of spaces to (auto)indent
set scrolloff=3 " keep 3 lines when scrolling
set showcmd " display incomplete commands
set hlsearch " highlight searches
set incsearch " do incremental searching
set ruler " show the cursor position all the time
set visualbell t_vb= " turn off error beep/flash
@Spaceghost
Spaceghost / .rvmrc
Created January 8, 2011 05:58
rvmrc - add your gemset name
#!/usr/bin/env bash
# This is an RVM Project .rvmrc file, used to automatically load the ruby
# development environment upon cd'ing into the directory
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
environment_id="ruby@gemset"
#
# First we attempt to load the desired environment directly from the environment
@Spaceghost
Spaceghost / application.rb
Created February 23, 2011 23:55
Mongoid fix for rails
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "rails/test_unit/railtie"
require "mongoid/railtie"
@Spaceghost
Spaceghost / deploy.rb
Created March 5, 2011 09:44
cap deploy:configs
desc "Sync the config directory."
task :configs do
run " if [ -d "#{shared_path}/config" ]; then mkdir -pv #{shared_path}/config; fi"
system "rsync -v config/database.yml #{user}@#{domain}:#{shared_path}/config/database.yml"
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/"
end
@Spaceghost
Spaceghost / DecryptWindowsProductKey.py
Created March 19, 2011 01:06
A script to decrypt windows product keys written in python
import _winreg
def DecodeKey(rpk):
rpkOffset = 52
i = 28
szPossibleChars = "BCDFGHJKMPQRTVWXY2346789"
szProductKey = ""
while i >= 0:
dwAccumulator = 0
@Spaceghost
Spaceghost / Math
Created April 29, 2011 03:45
Solve for i: 9x-7i > 3(3x-7u)
Solve for i: 9x-7i > 3(3x-7u)
9x-7i > 3(3x-7u)
-9x-7i > 9x-21u
-7i > -21u
-i > -3u
i < 3u
class Monoceros::Authentication::SessionsController < ApplicationController
def new
end
def create
user = User.authenticate(params[:login].downcase, params[:password])
if user
session[:user_id] = user.id
redirect_to monoceros_dashboard_url, :notice => "Logged in!"
- owner_only do
= link_to "My Control Panel", edit_bracket_path(@bracket), :title => 'Admin'