Skip to content

Instantly share code, notes, and snippets.

<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>
@becsegal
becsegal / list_manager_uniqs
Created August 9, 2011 13:51
Managing email lists to send only to new users
# 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
@becsegal
becsegal / v1_jots_public.json
Created October 3, 2011 03:47
GET /v1/jots/public.json
{
jots: [
{
created_at: 2011-10-03T02:21:42Z
comments: [ ]
id: 35922
subject: {
name: sports
id: 40
}
@becsegal
becsegal / api_v1_me.json
Created October 10, 2011 16:41
GET /api/v1/me.json
{
users: [
{
avatar_url: "/images/default-avatar.png"
name: "Marian Brick"
username: "mbrick"
id: 6076
description: null
}
]
@becsegal
becsegal / compare.sh
Created January 3, 2013 21:52
Compare your current git branch to another branch on github. Uses master as the default branch.
#! /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:"
@becsegal
becsegal / query_to_csv_concern.rb
Created September 24, 2013 02:11
ActiveRecord::Relation#to_csv
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
#
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<p id='artist'></p>
<p id='title'></p>
<script
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<p id='artist'></p>
<p id='title'></p>
<script