This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# | |
# Just change the three variables below and you are all set! | |
# @author Matthew A. Johnston (WarmWaffles) | |
# your user name | |
API_USERNAME = "username" | |
# your api key | |
API_KEY = "api-key" | |
# Load balancer Region |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class WidgetsController < ApplicationController | |
# ... | |
# other functions | |
# | |
def create | |
widget = Widget.new(params[:widget]) | |
widget.foo = some_thing | |
widget.bar = some_other_thing | |
widget.save! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# | |
# ... Other WP functions | |
# | |
function vimeo_transient_title($post) { | |
if( false === ($value = get_transient('vimeo_title_' . $post->ID) )) { | |
$vid_meta = get_post_meta($post->ID,'cmb_vimeo_id_field',true); | |
$url = 'http://vimeo.com/api/v2/video/' . $vid_meta . '.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/will_paginate.rb | |
module WillPaginate | |
module ActionView | |
def will_paginate(collection = nil, options = {}) | |
options[:renderer] ||= BootstrapLinkRenderer | |
super.try :html_safe | |
end | |
class BootstrapLinkRenderer < LinkRenderer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Widget < ActiveRecord::Base | |
# | |
# ..... extra crap here ..... | |
# | |
scope :active, where(:status => [:active]) | |
# | |
# This will fuzzy search the model for the provided query. It will split your |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
#------------------------------------------------------------------------------ | |
. /lib/lsb/init-functions | |
#------------------------------------------------------------------------------ | |
# Consts | |
#------------------------------------------------------------------------------ | |
PATH=/opt/nginx/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
DAEMON=/opt/nginx/sbin/nginx | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
# ... Initialize Devise and other crap .... | |
def self.authorize_omniauth(options={}, signed_in_resource=nil) | |
auth = Authentication.authorize(options[:auth][:provider], options[:auth][:uid]) | |
if auth | |
auth.set_omniauth_credentials(options[:auth]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SomeDumbMigration < ActiveRecord::Migration | |
def up | |
### .... | |
end | |
def down | |
raise "WHAT IN DA FUQ ARE YOU DOING" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>mac.bitlbee</string> | |
<key>ProgramArguments</key> | |
<array> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Athena | |
class Entity | |
attr_reader :components | |
def initialize | |
@components = Hash.new | |
end | |
def add component | |
@components[component.class] = component |
OlderNewer