Skip to content

Instantly share code, notes, and snippets.


Brian Cantoni bcantoni

View GitHub Profile
bcantoni /
Created Apr 8, 2014
Mods needed for migrating my blog from MovableType 4.x to WordPress 3.8
--- 2014-04-01 12:45:00.873266322 -0400
+++ 2014-04-01 17:35:53.995130625 -0400
@@ -483,15 +483,14 @@
AUTHOR: <$MTEntryAuthor strip_linefeeds="1"$>
TITLE: <$MTEntryTitle strip_linefeeds="1"$>
-BASENAME: <$MTEntryBasename$>
+BASENAME: <mt:IfNonEmpty tag="EntryKeywords"><$MTEntryKeywords$><mt:Else><$MTEntryTitle dirify="1"></mt:IfNonEmpty>
STATUS: <$MTEntryStatus strip_linefeeds="1"$>
ALLOW COMMENTS: <$MTEntryFlag flag="allow_comments"$>
View Cassandra Schemas
create KEYSPACE spark_demo WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};
create table spark_demo.raw_files (filename text,line int, contents text, PRIMARY KEY(filename,line));
create table spark_demo.users (id int PRIMARY KEY );
create table spark_demo.movies (id int PRIMARY KEY, name text, year int);
create table spark_demo.ratings (id int PRIMARY KEY, user_id int, movie_id int, rating float );
View gist:111953
$foo = "alert ('foo');";
open (FH, ">");
print FH $foo;
close (FH);
system ("java -jar yuicompressor-2.4.2.jar --type js < >file.out");
bcantoni / Makefile
Created Nov 4, 2011 — forked from pamelafox/Makefile
Closure/YUI/JsHint Makefile
View 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
BUILDDIR = ./.build
bcantoni / pushit.php
Created Nov 17, 2012
PHP script for uploading files & images to blog, including image reduction through service
View pushit.php
/* pushit
Command-line script for uploading files:
* reduce image file size thru online 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 / markdown.js
Created Nov 8, 2013
Bookmarklet: Copy page title and link in Markdown format
View markdown.js
bcantoni / Vagrantfile
Created Apr 22, 2016
Vagrant configuration for running WPScan (
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config| = "ubuntu/trusty64"
config.vm.provision "shell", privileged: true, inline: <<-SHELL1
apt-get update
apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev git -y
bcantoni /
Last active Apr 27, 2016
Simple conversion from podcast subscription OPML file into Markdown text
Convert podcast OPML file into Markdown format suitable for blog posting
Brian Cantoni
import opml
import codecs
import locale
import sys
bcantoni /
Last active May 30, 2017
A simple Python script to check a web link and report back on the redirects encountered
#!/usr/bin/env python
""" Check web URL and list all redirections """
import argparse
import requests
import sys
import time
bcantoni / friends.php
Last active Jun 1, 2018
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.
View friends.php
/* friends.php - use Twitter API to export data (CSV format) on people you are following
1. Install Twitter OAuth PHP library (
2. Adjust twitteroauth.php include path below
3. Create Twitter application (
4. Fill in 4 Twitter app keys below
5. Adjust $fields array if you want different fields saved