Skip to content

Instantly share code, notes, and snippets.

View jrob00's full-sized avatar

Jason Roberts jrob00

  • Simi Valley, CA
View GitHub Profile
@engelfrost
engelfrost / LICENSE
Last active September 2, 2020 11:15
Fake localStorage. Useful for Safari Private Browsing and browsers that don't implement localStorage.
The MIT License (MIT)
Copyright (c) 2015 Textalk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@jjcody
jjcody / gist:c98e3a5ba3f67d5d54c6
Created June 18, 2014 17:58
Simple example of aes-256-cbc encryption for Ruby/Rails to encrypt URL params (or any text)
# Simple example of aes-256-cbc encryption for Ruby/Rails to encrypt URL params (or any text)
require 'openssl'
require 'base64'
require 'uri'
plaintext = 'id=example_id&user_id=the_user_id&username=voxtrot&user_first_name=john&user_last_name=doe&user_image=http://i1.nyt.com/images/misc/nytlogo379x64.gif'
#
@jrob00
jrob00 / gist:5726193
Created June 7, 2013 00:22
Gemfile Bootstrap
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0.rc1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0.rc1'
@scottjacobsen
scottjacobsen / git+clone+ssh+agent+forward+sudo
Created December 14, 2012 00:07
Git clone using ssh agent forwarding and sudo
SSH agent forwarding is great. It allows you to ssh from one server to
another all the while using the ssh-agent running on your local
workstation. The benefit is you don't need to generate ssh key pairs
on the servers you are connecting to in order to hop around.
When you ssh to a remote machine the remote machine talks to your
local ssh-agent through the socket referenced by the SSH_AUTH_SOCK
environment variable.
So you the remote server you can do something like:
@timcheadle
timcheadle / README.md
Last active January 26, 2023 00:56
Make /robots.txt aware of the Rails environment

Make /robots.txt aware of the Rails environment

You probably don't want Google crawling your development staging app. Here's how to fix that.

$ mv public/robots.txt config/robots.production.txt
$ cp config/robots.production.txt config/robots.development.txt

Now edit config/routes.rb to add a route for /robots.txt, and add the controller code.

@jeremyhicks
jeremyhicks / gist:3516385
Created August 29, 2012 18:08
Custom Mac OS X Preferences
# expand save dialog sheet
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# allow key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# finder cmd-q
defaults write com.apple.finder QuitMenuItem -bool true
# text selection in quick look
@jeremyhicks
jeremyhicks / Preferences.sublime-settings
Last active October 8, 2015 00:58
Sublime Settings
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/User/Tomorrow-Night (SL).tmTheme",
"drag_text": false,
"find_selected_text": true,
"flatland_square_tabs": true,
"folder_exclude_patterns":
[
".svn",
@torifat
torifat / php-switch
Created July 30, 2012 18:11
a php switching utillity for homebrew
#!/bin/bash
# php switch for homebrew
# $ brew tap josegonzalez/php && brew install php53 --with-mysql && brew install php54 --with-mysql
# Might as well ask for password up-front, right?
sudo -v
VERSION_FILE="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/php-switch.version"
@jrob00
jrob00 / gist:2306944
Created April 5, 2012 00:44
local clover virtualhosts file
NameVirtualHost *:80
NameVirtualHost *:443
#DocumentRoot "/var/www/html"
<Directory />
Options -Indexes +FollowSymLinks
Order allow,deny
Allow from all
</Directory>
@jrob00
jrob00 / caveatPatchor.js
Created March 1, 2012 23:28 — forked from protocool/caveatPatchor.js
Sample Propane caveatPatchor.js // with current hacks
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.