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/concern' | |
require 'csv' | |
module QueryToCSVConcern | |
extend ActiveSupport::Concern | |
# Dump ActiveRecord::Relation to a csv file. | |
# Data will always order ascending based on first order parameter given | |
# Ignores order and limit options like find_each | |
# |
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 | |
# compare your current checked out git branch to another branch on github | |
# default branch is master | |
# usage: | |
# ./compare.sh | |
# ./compare.sh staging | |
old=$1 | |
if [ -z $1 ]; then | |
echo "Comparing to master. If you want to compare to a different branch use:" |
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
{ | |
users: [ | |
{ | |
avatar_url: "/images/default-avatar.png" | |
name: "Marian Brick" | |
username: "mbrick" | |
id: 6076 | |
description: null | |
} | |
] |
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
{ | |
jots: [ | |
{ | |
created_at: 2011-10-03T02:21:42Z | |
comments: [ ] | |
id: 35922 | |
subject: { | |
name: sports | |
id: 40 | |
} |
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
# do_not_send list: merge (if required), sort, downcase, and de-dupe | |
cat exclude1 exclude2 | awk '{print tolower($0)}' | sort | uniq > do_not_send | |
# large list: repeat process | |
cat file1 | awk '{print tolower($0)}' | sort | uniq > big_list | |
# get the entries that are unique to the big_list | |
comm -13 do_not_send big_list > send |
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
<div id="fb_comments"> | |
<fb:comments title="Comment Test - Social Plugin" numposts="5" | |
xid="set_publish_feed_to_false_demo" simple="1" | |
width="510" reverse="false" publish_feed="false"> | |
</fb:comments> | |
</div> | |
<div id="fb-root"></div> | |
<script> |
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
# Override link_to to link to the facebook app address and | |
# set target=_top when in a facebook iframe, using Facebooker | |
def link_to(name, options = {}, html_options = {}) | |
if params[:fb_sig_in_iframe] | |
rel = url_for options | |
url = "http://apps.facebook.com/" + FACEBOOKER['canvas_page_name'] + rel | |
html_options[:href] = url | |
html_options[:target] = "_top" | |
super(name, {}, html_options) | |
else |
NewerOlder