Skip to content

Instantly share code, notes, and snippets.

View timdp's full-sized avatar

Tim De Pauw timdp

View GitHub Profile
@timdp
timdp / tweets_per_day.php
Created May 30, 2012 13:47
Tweets per day chart
<?php
// Plots a user's daily tweet count using Google Chart Tools
// Limited to about 3200 tweets by the Twitter API
// Hacked together by @tmdpw on 2012-05-30
if (count($argv) != 3) {
die("Usage: php $argv[0] USERNAME FILENAME");
}
@timdp
timdp / tweet_rhythm.php
Created May 30, 2012 14:10
Tweets rhythm chart
<?php
// Plots a user's tweet rhythm using Google Chart Tools
// Limited to about 3200 tweets by the Twitter API
// Hacked together by @tmdpw on 2012-05-30
if (count($argv) != 3) {
die("Usage: php $argv[0] USERNAME FILENAME");
}
@timdp
timdp / analyze-twitter-archive.php
Last active December 11, 2015 06:59
Twitter Archive Analyzer
<?php
// Twitter Archive Analyzer
// @tmdpw, 2013-01-18
// https://github.com/timdp
// Instructions:
// 1. Request your Twitter archive from twitter.com.
// 2. Extract the zip file you obtained.
// 3. Run this script with the extraction path as its argument.
#!/usr/bin/perl
use strict;
use warnings;
use Carp;
use Pod::Usage;
use constant INKSCAPE => 'C:/Program Files (x86)/Inkscape/inkscape.exe';
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Bouncy</title>
<style>
html, body {
margin: 0;
padding: 0;
width: 100%;
<?php
//
// delete-old-tweets.php - https://github.com/timdp
//
// -- Instructions --
// 1. Save this script somewhere as delete-old-tweets.php
// 2. Get your Twitter archive and extract it to the same folder
// 3. Clone https://github.com/themattharris/tmhOAuth to the same folder
// 4. Register an app at dev.twitter.com and enter its credentials below
<!DOCTYPE html>
<html>
<head>
<title>Flexbox</title>
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
}
<?php
# Idle tweeps
# by @tmdpw
# 1. Clone https://github.com/themattharris/tmhOAuth
require_once dirname(__FILE__) . '/tmhOAuth/tmhOAuth.php';
# 2. Enter your screen name
define('SCREEN_NAME', '...');
@timdp
timdp / update-packages.pl
Last active February 7, 2016 02:24
update-packages.pl
#!/usr/bin/perl
use 5.010;
use strict;
use warnings;
use Carp;
use File::Basename;
use File::Slurp;
use File::Spec;
use JSON;
@timdp
timdp / sanitize.js
Created December 2, 2014 17:44
Simple self-contained HTTP sanitizer
var sanitize = (function() {
var re = /(.*?)<(\/?)\s*([A-Za-z]+)[^>]*>/mg;
var blockElements = ['br', 'div', 'p', 'blockquote'];
var inlineBlockElements = ['img'];
var sanitize = function(input) {
input = input.replace(/\s+/g, ' ');
var out = '';
var index = 0;