Skip to content

Instantly share code, notes, and snippets.

@russellbeattie
russellbeattie / update_git_dirs.sh
Created April 28, 2013 23:18
I have a directory where I clone interesting github repos - here's quick script to update them all at once.
p=`pwd`
for dirname in `find . -type d -maxdepth 1 -mindepth 1`
do
if [ -d $dirname/.git ]
then
cd $dirname
echo `pwd`
git pull origin master
fi
cd $p
@russellbeattie
russellbeattie / google_reader_bundle_subs.opml
Created May 9, 2013 05:06
Added all 449 "Bundles" that Google Reader provides, plus their 27 "featured bundles" from famous people, and then added some top feeds that were the result of searches for a few keywords.
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Google Reader Bundles</title>
</head>
<body>
<outline title="Media Center" text="Media Center">
<outline text="Charlie Owen" title="Charlie Owen" type="rss"
xmlUrl="http://blog.retrosight.com/SyndicationService.asmx/GetRss" htmlUrl="http://blog.retrosight.com/"/>
<outline text="Chris Lanier" title="Chris Lanier" type="rss"
@russellbeattie
russellbeattie / check_free_io.py
Created May 10, 2013 09:23
Cranks up the number of simultaneous requests, but nic.io just barfs at you after a short while.
# works on my machine... OS X 10.8.2, Python v2.7.3
import sys
import subprocess
import multiprocessing
def checkName(q):
proc_name = multiprocessing.current_process().name
package feeds
var Ns = map[string]string{
// via http://feed2.w3.org/docs/howto/declare_namespaces.html
"http://a9.com/-/spec/opensearch/1.1/": "opensearch",
"http://a9.com/-/spec/opensearchrss/1.0/": "opensearch10",
"http://backend.userland.com/blogChannelModule": "blogChannel",
"http://backend.userland.com/creativeCommonsRSSModule": "creativecommons",
"http://backend.userland.com/creativeCommonsRssModule": "creativeCommons",
@russellbeattie
russellbeattie / A-Pen-by-Russell-Beattie.markdown
Created September 29, 2013 17:38
A Pen by Russell Beattie.
@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 / 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 / aws-twitter-search-bot.js
Last active January 19, 2016 00:42
AWS Lambda Twitter Search Bot... uses S3 for persistence and SNS to send out messages.
var querystring = require('querystring');
var https = require('https');
var aws = require('aws-sdk');
var s3 = new aws.S3();
var sns = new aws.SNS({
region: 'us-east-1'
});
var query = '#SEARCH TERM HERE';
@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 / search-apple-mail-body.js
Created June 1, 2016 01:11
Searches Apple mail Inbox for your name (if your name is Russ - otherwise change that bit) in the latest message and logs out/marks yellow.
#!/usr/bin/env osascript -l JavaScript
function run(argv) {
var Mail = new Application("Mail");
var inbox = Mail.inbox();
var messages = inbox.messages();