Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Restarts Pow when DNS fails to resolve
lsof | grep 20560 | awk '{print $2}' | xargs kill -9
launchctl unload ~/Library/LaunchAgents/cx.pow.powd.plist
launchctl load ~/Library/LaunchAgents/cx.pow.powd.plist
@orendon
orendon / gist:5608055
Created May 19, 2013 15:50
HipChat Heroku deploy hook
heroku addons:add deployhooks:http url="https://api.hipchat.com/v1/webhooks/heroku?auth_token=<TOKEN>&room_id=<ROOM>"
#!/bin/bash
#
# Install Postgres 9.2 on a clean Ubuntu 12.04
"""
LC_ALL issue
comment out the AcceptEnv LANG LC_* line in the remote /etc/ssh/sshd_config file.
sudo apt-get install language-pack-en-base
sudo dpkg-reconfigure locales
comment out the SendEnv LANG LC_* line in the local /etc/ssh/ssh_config file.
def select_from_chosen(item_text, options)
field = find_field(options[:from])
option_value = page.evaluate_script("$(\"##{field[:id]} option:contains('#{item_text}')\").val()")
page.execute_script("$('##{field[:id]}').val('#{option_value}')")
end
@orendon
orendon / ArduinoPointers.ino
Last active December 24, 2015 01:09
arduino pointers
void loop()
{
byte data[2];
read_data(&data);
}
void read_data(byte *pdata)
{
pdata[0] = 'a';
@orendon
orendon / .slate
Last active December 24, 2015 01:59
slate basic config ~/.slate https://github.com/jigish/slate
# My basic ~/.slate file.
# It has some tweaks so it doesn't fuck with my IDE
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Resize Bindings -> resize
bind right:alt;ctrl resize +5% +0
bind left:alt;ctrl resize -5% +0
@orendon
orendon / init.el
Created September 29, 2013 13:27 — forked from mig/init.el
;; emacs configuration
(push "/usr/local/bin" exec-path)
(add-to-list 'load-path "~/.emacs.d")
(setq make-backup-files nil)
(setq auto-save-default nil)
(setq-default tab-width 2)
(setq-default indent-tabs-mode nil)
(setq inhibit-startup-message t)
module ActiveAdmin
class ResourceDSL
def filter(*args)
field = args[0]
klass = @config.resource_class_name.constantize
type = klass.columns.select{|c| c.name == field.to_s}.first.try(:type)
if type == :datetime
controller do
before_filter :only => :index do
@orendon
orendon / Preferences.sublime-settings
Last active December 25, 2015 07:59
Preferences.sublime-settings
{
"color_scheme": "Packages/Theme - Spacegray/base16-eighties.dark.tmTheme",
"ignored_packages":
[
"Vintage"
],
"theme": "Spacegray Eighties.sublime-theme",
"highlight_modified_tabs": true,
"highlight_line": true,
"tab_size": 2,