Skip to content

Instantly share code, notes, and snippets.

@0xnbk
0xnbk / favicon-interceptor.js
Created February 20, 2012 08:57 — forked from kentbrew/favicon-interceptor.js
How to short-circuit those annoying favicon requests in node.js
// early experiments with node had mysterious double requests
// turned out these were for the stoopid favicon
// here's how to short-circuit those requests
// and stop seeing 404 errors in your client console
var http = require('http');
http.createServer(function (q, r) {
// control for favicon
@0xnbk
0xnbk / twitter.php
Created November 5, 2010 10:57 — forked from abraham/twitter.php
How to tweet with OAuth in three lines
<?php
// Download the latest version of TwitterOAuth from http://github.com/abraham/twitteroauth/downloads
// Unpack the download and place the twitteroauth.php and OAuth.php files in the same directory as this file.
// Register an application at http://dev.twitter.com/apps and from your new apps page get "my access token".
require_once('twitteroauth.php');
$connection = new TwitterOAuth('app consumer key', 'app consumer secret', 'my access token', 'my access token secret');
$connection->post('statuses/update', array('status' => 'text to be tweeted'));
@0xnbk
0xnbk / culturegridne.1.4.bat
Created September 13, 2010 08:41
Twitter Bot (bat file)
@echo off
rem ==============================
rem test for user input
rem ==============================
if [%1]==[] goto error
if [%2]==[] goto error
rem ==============================
rem set password and user name
rem ==============================
set user=%1
require 'net/http'
require 'uri'
# /api/v1/:format/new
# /api/v1/:format/gists/:user
# /api/v1/:format/:gist_id
res = Net::HTTP.post_form(URI.parse('http://gist.github.com/api/v1/xml/new'),
{ 'files[file1.ab]' => 'CONTNETS',
'files[file2.ab]' => 'contents' })