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
def search(tp_id1, rule_id1, tp_id2, rule_id2)
ActiveRecord::Base.connection.execute("SELECT * FROM tracked_points, rules WHERE (tracked_points.id = ? AND rules.id = ?) OR (tracked_points.id = ? AND rules.id = ?)", tp_id1, rule_id1, tp_id2, rule_id2)
end
iVBORw0KGgoAAAANSUhEUgAAAMgAAAEqCAYAAABQox+jAAAABmJLR0QA/wD/AP+gvaeTAAAgAElEQVR4nOydd5hcVd3HP+fcMr1s3+xuNptGAkkIhBIIvYUiJBRRkC5gR1BQ9EVRRKSIygsqKIoor6Ioamg2ejPUJEB6SN1kd5PtZeq997x/TMr2OpuQyf08zzzJ7Nzyu3fud875lXMOuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uGSTiwHRz+dRIH832eListuZ2dcHV388cAOgSgu0y/vYxPSYot1jigX9ncDvkZ8F5LAtdHEZBSJScv0A2xwDKODQXj4LFkRlR8AnVF5YNgOe7hvkR+Qft++vfD6O7u0EQb+8efs2pw/JeheXUUYAalyZ9su+NvD7xDuA8piiBijq/FkkKG+aPM7r1L1QqcqLdScclN/qtvslXlNY//1dubrizKgaU6TVAnq3bS7SdayqMkPlR8UrfZhR5jHEv3vZ18Vl1FGAKorKa3r57GyvR1rLFxyojjjQkw75xWuAtv0z0+8TzQ/98BjVsXC8uvcrY5TXFHEy/gbAOF2j44Hv5KmWV8ar93+7nyop0GyPR97Q6fjzpMB65I4C9ez/VikhcIBJ3Wyo0HWqAeUz+WQ/1yGA/YZ++S4u/aO+87X5ytClY2hc0vkDwxDLv/Xlw53UkgPVu7+ZqIrzNauiWL9z+8dnh4OalVhzrUq8M06tfWyqmlBh2JGgvAlACJ46/jBPu/PBWNXy6ni1/s9T1U+/VqJMQ7QBEWB/KYj9+OvRhPPBWLXx8alq9nRvCrirkwl+IVh8wmGels+eF1GlRfL9Pq7B4/OI1ZrGv7J9c1z6Zp9xGE8/aQa/vONEoeA3wInb/3wcisnXfu4coWvNjCnS+Mm1JVpdo/21QIAD88PiCxfOm6qZ

PHP

As this creature lurches ever forward, grasping with muddied hands, taking purchase upon once hallowed grounds, I recoil in disgust and regret at its caustic stench and encrusted likeness. The effervescent entrails of this destructive creation spreads the slimy secretions of its unconstrained calamity over all once held dear.

All the while I cannot staunch the paralyzing fear that oozes from my pores, hysteria of that which I once knew having grown far beyond what I ever imagined during years of naivety overcomes my courage, wresting it ever downwards into abandon.

It's lugubrious nature, once seen as fortuitous manifestations of an imperfect world further expound my illustrious ignorance as this creature, further compounded by abject moral deprivation and dismal fragmentation, has cost me more than I might convey through words alone.

It is this reprehensible companion of chaos that holds captive the futures of many. It is this felonious phantasm that grips the hearts of ones less fortunate, taunti

@Spaceghost
Spaceghost / non-login-shell
Created August 22, 2013 21:32
This is how I make my non-login shell use my preferred login shell as a non-login shell, instead of /bin/bash
PREFERRED_SHELL=$(finger $USER | grep "Shell" | cut -d ':' -f 3 | sed -e 's/^[[:space:]]*//')
if [[ "$0" != "$PREFERRED_SHELL" ]]; then
exec $PREFERRED_SHELL
fi
SHELL=$PREFERRED_SHELL
#!/bin/bash
for i in $(seq 100)
do
fizz_mod=$(($i % 3))
buzz_mod=$(($i % 5))
out=""
if [ "$fizz_mod" -eq 0 ]; then
out="Fizz"
fi
if [ "$buzz_mod" -eq 0 ]; then
# Module
# ------
module ProtectedFields
# There is probably a nicer way to do this...
def self.included(base)
base.class_eval {
def self.protected_attributes(attrs = [])
@@protected_attributes = attrs
end
-=[ group hug ]=-
______________________________
.-' G R O U P H U G '-.
.' ________________________ '.
/ .-'(")/6 6\(") /o o\("/6 6\'-. \
/ /o o\(") =_//a a\_=_/_(")-_/a a\ \
| /\ -/o o\"/ )\_^_/(")( \/o o\_-_/\ |
| \(")\ - // /___/o o\__\ \ = /(")"/ |
\ '------' ____) -(____ '------' /
\ _____)(____ /
<?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>Label</key>
<string>net.damacy.releasemem</string>
<key>ProgramArguments</key>
<array>
<string>/Users/jrollins/usr/bin/releasemem.py</string>
</array>
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
make
make install
@Spaceghost
Spaceghost / login_page_spec.rb
Created February 8, 2013 18:15
Capybara does seem to handle button tags inside forms.
require 'spec_helper'
def login_as email, password
visit new_session_path
fill_in "Email", with: email
fill_in "Password", with: password
save_and_open_page
click_on "sign-in"