Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bcantoni's full-sized avatar

Brian Cantoni bcantoni

View GitHub Profile
@bcantoni
bcantoni / markdown.js
Created November 8, 2013 20:14
Bookmarklet: Copy page title and link in Markdown format
javascript:var%20text='['+document.title+']('+location.href+')';window.prompt("Copy%20to%20clipboard:%20Ctrl+C,%20Enter",text);void(0);
@bcantoni
bcantoni / friends.php
Last active July 12, 2022 21:46
Use Twitter API to export data (in CSV format) on people you are following. See Installation notes for steps. Prerequisites: 1) Twitter OAuth PHP library 2) Create your own Twitter application and OAuth keys/tokens.
<?php
/* friends.php - use Twitter API to export data (CSV format) on people you are following
Installation:
1. Install Twitter OAuth PHP library (https://github.com/abraham/twitteroauth)
2. Adjust twitteroauth.php include path below
3. Create Twitter application (https://dev.twitter.com/apps)
4. Fill in 4 Twitter app keys below
5. Adjust $fields array if you want different fields saved
@bcantoni
bcantoni / pushit.php
Created November 17, 2012 03:32
PHP script for uploading files & images to blog, including image reduction through smush.it service
#!/usr/bin/php
<?php
/* pushit
Command-line script for uploading files:
* reduce image file size thru online Smush.it service
* add file signature (md5) to name for uniqueness and long expiration times
* configurable copy command to blog, Amazon S3, etc.
* configurable move original file to local archive
@bcantoni
bcantoni / json-int.php
Created March 22, 2012 19:42
Demo of PHP workaround for large integers in JSON data responses
<?php
/* Demonstration of problem with large integers in JSON, and
a couple options for dealing with them as strings instead.
ref:
* http://php.net/manual/en/function.json-decode.php
* http://stackoverflow.com/questions/2907806/handling-big-user-ids-returned-by-fql-in-php
*/
$json = <<<EOT
@bcantoni
bcantoni / Makefile
Created November 4, 2011 05:34 — forked from pamelafox/Makefile
Closure/YUI/JsHint Makefile
# Makefile for JS/CSS:
# Uses Closure for JS compiling, YUI for CSS compiling, and JsHint for code quality checking
MAKEFLAGS = --no-print-directory --always-make
MAKE = make $(MAKEFLAGS)
BUILDDIR = ./.build
CLOSUREURL = http://closure-compiler.googlecode.com/files/compiler-latest.zip
CLOSUREDIR = $(BUILDDIR)/closure
#!/usr/bin/perl
$foo = "alert ('foo');";
open (FH, ">file.in");
print FH $foo;
close (FH);
system ("java -jar yuicompressor-2.4.2.jar --type js <file.in >file.out");