Skip to content

Instantly share code, notes, and snippets.

@russellbeattie
russellbeattie / gist:11205288
Created April 23, 2014 07:10
Enabling remote debugging in apps using Cordova targeting Amazon Fire OS
package com.example.helloworld;
import android.os.Bundle;
import org.apache.cordova.*;
public class HelloActivity extends CordovaActivity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
@russellbeattie
russellbeattie / twitterfeed.php
Created October 16, 2012 10:08
Twitter stream as a feed in Atom format (using oauth)
<?
/**
* twitterfeed.php
*
* A single file script which serves an authenticated personal Twitter timeline as an Atom feed.
*
* To use:
* 1) Go to https://dev.twitter.com/apps and create a new App
* 2) Use the Authentication button to create the tokens/secrets needed
* 3) Copy the results into the appropriate spots below
@russellbeattie
russellbeattie / Dispatcher.js
Last active November 5, 2015 06:26
Clean version of Flux Dispatcher
/**
* Copyright (c) 2014-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in
* https://github.com/facebook/flux/blob/master/LICENSE. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
@russellbeattie
russellbeattie / getfeed-nolibs.js
Created December 9, 2015 10:09
Just a quick library-free script to grab a feed and parse it
var https = require('https');
var http = require('http');
var url = require('url');
var feedUrl = 'http://www.techmeme.com/feed.xml';
main();
function main(){
@russellbeattie
russellbeattie / io-domains.txt
Last active December 12, 2015 10:39
List of interesting (non-blog or useless) .io domains
http://action.io
http://add.io
http://adstage.io
http://airbrake.io
http://animation.io
http://ansr.io
http://apc.io
http://apiary.io
http://apis.io
http://appetite.io
@russellbeattie
russellbeattie / check_free_io.py
Last active December 13, 2015 22:08
script to check free real word .io domains
# works on my machine... OS X 10.8.2, Python v2.7.3
import sys
import subprocess
wordlist = 'words.txt'
if len(sys.argv) > 1:
wordlist = sys.argv[1]
@russellbeattie
russellbeattie / check_active_io.py
Created February 20, 2013 07:22
Script to check .io domains to see if they're being used for anything... Works through a word list, checks to see if it's just being redirected or not, then if not, prints out the domain and title of the page (which could give a clue to what it's used for).
# works on my machine... OS X 10.8.2, Python v2.7.3
# use the wordlist here: https://gist.github.com/russellbeattie/4982393#file-words-txt
import sys
import subprocess
import re
import urllib2
wordlist = 'words.txt'
@russellbeattie
russellbeattie / colorOutput.js
Created March 18, 2013 02:54
Function to color the output in Node.js console.log() . I didn't realize until after I wrote this that utils.inspect sorta does the same thing.
function colorOutput(text, color){
color = color.toLowerCase();
var colors = {
'black':'0;30',
'dgray':'1;30',
'lgray':'0;37',
'blue':'0;34',
'lblue':'1;34',
package main
import (
_ "github.com/bmizerany/pq"
"database/sql"
"net/http"
"log"
"net"
"time"
"strconv"
var utils = require('../utils.js'),
pg = require('pg').native,
http = require('http'),
httpreq = require('./httpreq.js'),
async = require('async'),
events = require('events'),
lodash = require('lodash');
var app = new events.EventEmitter();