Skip to content

Instantly share code, notes, and snippets.

@bencevans
bencevans / gist:3513313
Created August 29, 2012 14:23 — forked from mebcomputers/gist:2550712
php: create visitor log file
<?php
class log {
public $filename;
public $timestamp;
public $ip;
public $u_agent;
public $u_refer;
public $ub;
@bencevans
bencevans / Makefile
Created November 5, 2018 17:58
GitHub Style Markdown -> PDF with Pandoc + Weasyprint
build:
pandoc writing.md --standalone \
--bibliography writing.bib --csl writing.csl \
-c https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/2.10.0/github-markdown.css \
-t html \
| sed '/<body>/c\<body class="markdown-body">' \
| weasyprint - output.pdf
@bencevans
bencevans / tld2whois.json
Created November 3, 2012 01:08
TLD -> WHOIS Server in JSON (Originally from http://www.nirsoft.net/whois_servers_list.html)
{
"ac":"whois.nic.ac",
"ae":"whois.nic.ae",
"af":"whois.nic.af",
"ag":"whois.nic.ag",
"al":"whois.ripe.net",
"am":"whois.amnic.net",
"as":"whois.nic.as",
"at":"whois.nic.at",
"au":"whois.aunic.net",
@bencevans
bencevans / exec.js
Last active December 8, 2022 05:00
Music Reddits Scrape
// http://www.reddit.com/r/Music/wiki/musicsubreddits
var musicReddits = $('a').filter(function() { return $(this).text().match(/^\/r\//); });
// array
musicReddits.map(function() { return $(this).text(); }).toArray();
// console.log
@bencevans
bencevans / gist:5162086
Created March 14, 2013 15:06
spotify-web skeleton

var Spotify = require('spotify-web');

{ [Function: Spotify]
  gid2id: [Function],
  id2uri: [Function],
  uri2id: [Function],
  gid2uri: [Function],
  uriType: [Function],
  login: [Function],

super_: [Function: EventEmitter] }

/**
* L.TileLayer is used for standard xyz-numbered tile layers.
*/
L.Google = L.Class.extend({
includes: L.Mixin.Events,
options: {
minZoom: 0,
maxZoom: 18,
@bencevans
bencevans / keybase.md
Created December 23, 2019 16:24
keybase.md

Keybase proof

I hereby claim:

  • I am bencevans on github.
  • I am bencevans (https://keybase.io/bencevans) on keybase.
  • I have a public key ASCcacXpuZoLtEql7RBh6Qan9X3NjqBIF-WPotYbn8lFZAo

To claim this, I am signing this object:

@bencevans
bencevans / dabblet.css
Last active October 21, 2019 21:41
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
html, body {
font-family: 'Inconsolata', monospace;
max-width: 800px;
}
table {
@bencevans
bencevans / keybase.md
Created December 23, 2017 22:44
keybase.md

Keybase proof

I hereby claim:

  • I am bencevans on github.
  • I am bencevans (https://keybase.io/bencevans) on keybase.
  • I have a public key ASBdQHTwQoYlNESpTFvtlpIvn5A_OsGx-F2T-3l7TyeK0wo

To claim this, I am signing this object:

@bencevans
bencevans / dabblet.css
Created February 25, 2017 12:12
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
}