Skip to content

Instantly share code, notes, and snippets.

View afeld's full-sized avatar

Aidan Feldman afeld

View GitHub Profile
@afeld
afeld / countdown.js
Created August 18, 2012 17:23
Corsonus countdown
var startTimeInterval = setInterval(function(){
jQuery.getJSON('http://api.corsonus.com/start.json?callback=?', function(data){
var startTime = data.start_time;
if (startTime){
clearInterval(startTimeInterval);
console.log('counting down...');
var countdownInterval = setInterval(function(){
// number of seconds
var remaining = Math.round((startTime - Date.now()) / 1000);
console.log('number of seconds remaining: ' + remaining);
@afeld
afeld / gist:3549307
Created August 31, 2012 05:18
upgrading to Mountain Lion
# run Apple's Software Update
# open XCode, then XCode(menu)->Preferences->Downloads tab and Install the Command Line Tools
brew update
brew doctor
# follow any instructions - mine are included below
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
brew link apple-gcc42 # for some reason this didn't work in prior step
@afeld
afeld / gist:3620993
Created September 4, 2012 13:07
test for finding cluster in SQL graph
DROP TABLE IF EXISTS profile_matches;
DROP TABLE IF EXISTS profiles;
-- the "nodes"
CREATE TABLE profiles (
id SERIAL PRIMARY KEY,
service text,
username text
);
@afeld
afeld / results.md
Last active October 11, 2015 15:08
Jux Video Dimensions

Dimensions of Videos on Jux Dimensions of Videos on Jux by Service Most Common Video Dimensions on Jux

@afeld
afeld / _setup.txt
Last active September 13, 2022 18:34
Seven Languages in Seven Months: Ruby presentation
git clone git://gist.github.com/3944262.git seven_langs_ruby
cd seven_langs_ruby
gem install gli -v 1.6.0
gem install showoff
showoff serve
open "http://localhost:9090"
@afeld
afeld / deploy1.txt
Created November 7, 2012 07:54
Nodejitsu deployment problem
➜ jsonp git:(master) ✗ jitsu deploy
info: Welcome to Nodejitsu aidanfeldman
info: jitsu v0.10.5, node v0.8.11
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in server.js
debug: { method: 'GET',
debug: uri: 'http://api.nodejitsu.com/apps/aidanfeldman/jsonp',
debug: headers:
debug: { Authorization: 'Basic YWlkYW5mZWxkbWFuOmN1YmJpZTE=',
@afeld
afeld / gist:4539970
Last active December 11, 2015 03:48
Jux: emails from Airbrake
# We had introduced a bug that was causing user registration errors in Rails for certain email addresses.
# Fetch the list of unique emails that had failed registration (that produced a particular exception).
require 'open-uri'
require 'nokogiri'
require 'set'
AUTH_TOKEN = 'XXX'
ERROR_ID = '54425478'
@afeld
afeld / gist:4725026
Last active December 12, 2015 05:49 — forked from robreuss/gist:4725007
{
"multiquark": {
"quarks": [
{
"background_picture": {
"id": "5112ac3d94b23b743c00001e"
},
"text": "First Page",
"title": "stuff"
},
@afeld
afeld / gist:4952991
Last active February 8, 2022 03:13
good APIs for mashups

This list has been superseded by Public APIs. Check there for APIs with Auth: No, HTTPS and CORS Yes.


List of data APIs that require no server-side auth or private credentials, and are thus good for small browser-only JS projects.

@afeld
afeld / gist:5003570
Last active April 13, 2020 17:03
GoDadddy->local Wordpress development setup

I've seen waaaay too many people modifying their Wordpress sites live, which is fragile because when (not "if") you break something, your visitors will see it. Here are steps for setting up a copy of your site locally, so you can muck around without worry. These instructions are for Wordpress sites hosted on GoDaddy specifically, but they should be fairly easy to interpret for other providers.

To back up your database

  1. Log into GoDaddy, and go to "My Account".
  2. Under "Web Hosting", click Launch next to your site's name.
  3. Under "Databases", click "MySQL".
  4. Next to your database name, click "Actions"->"Back Up".
  5. Log into FTP, and under /_db_backups/ you'll see a new *.sql file.
  6. Rename this to be mydb-YYMMDD.sql format (e.g. superwordpress-130220.sql).