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
import urllib2 | |
import json | |
import datetime | |
'''Constants''' | |
catSubreddits = ['cat','catpictures','cats','flyingcats','catgifs','lolcats'] | |
''' Prompt for num days back ''' | |
nDaysSet=False | |
while nDaysSet is not True: |
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
<snippet> | |
<content><![CDATA[/** | |
* Function: ${1:Name} | |
* Usage: ${1:Name}(${2:params}) | |
* -----------${1/./\-/g}${2/./\-/g} | |
* ${4:Description} | |
*/]]></content> | |
<tabTrigger>funcdesc</tabTrigger> | |
<description>Function name, usage, and description</description> | |
<scope>source.c, source.h, source.cpp</scope> |
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
//- Pagination mixin | |
//- ---------------- | |
//- start=# to start pagination at | |
//- numPages=# links to serve up | |
//- base=base url before num | |
//- | |
//- Example: | |
//- pagination(3,5,4,'/fda/') | |
//- Yields: | « | 3 | 4 | 5 | 6 | 7 | » | | |
//- « = /fda/2, 3 = /fda/3, 4 = #, .. 7 = /fda/7, » = /fda/8 |
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
tell application "Messages" | |
quit | |
end tell | |
tell application "HipChat" | |
quit | |
end tell | |
tell application "Cryptocat" | |
quit |
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/bash | |
cmd="$(cut -d ' ' -f 1 <<< "$@" )"; | |
args="$(cut -d ' ' -f 2- <<< "$@" )"; | |
url="http://explainshell.com/explain/$cmd?args=$args" | |
explanation="$(curl -s $url | grep '<pre' | sed -E 's/<\/?[a-z]+(\ [a-z]+=\"[a-z0-9]+\")*>//g' | sed -E 's/^\ +//g')" | |
echo "$explanation" |
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 EngineControllerPatch | |
def self.included(base) | |
@http_methods ||= [ :get, :post, :put, :patch, :delete ] | |
@http_methods.each { |http_method| patch_http_method http_method } | |
end | |
def self.patch_http_method(http_method) | |
define_method(http_method) do |action, parameters = nil, session = nil, flash = nil| | |
process_action(action, parameters, session, flash, http_method.to_s.upcase) | |
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
require 'active_support' | |
require 'active_support/core_ext' | |
require 'active_record' | |
require 'test/unit' | |
# Setup | |
ActiveRecord::Base.establish_connection( | |
:adapter => "sqlite3", | |
:database => ":memory:" |
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
require 'factory_girl' | |
require 'faker' | |
class JsonStrategy # From http://git.io/vT8kC | |
def initialize | |
@strategy = FactoryGirl.strategy_by_name(:create).new | |
end | |
delegate :association, to: :@strategy |
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
source 'https://rubygems.org' | |
ruby '2.2.2' | |
group :development do | |
# Handle file system changes and run things | |
gem 'guard', '~> 2.12.4' | |
# Intelligently Autorun Tests | |
gem 'guard-rspec', '~> 4.2.0' |
OlderNewer