Skip to content

Instantly share code, notes, and snippets.

@bencevans
bencevans / index.js
Created June 5, 2013 19:49
@gifs Tweets 2 Images
$('.tweet').each(function() {
if($(this).find('.username').text() == '@GIFs') {
var el = $(this).find('.tweet-text');
el.html('<img style="max-width: 100%;" src="' + el.text() + '" alt="' + el.text() + '"/>');
}
});
@bencevans
bencevans / tom
Created June 16, 2013 19:33
Tomahawk (DBUS) CLI
#!/bin/bash
# Credit to azzid for Spotify version - http://ubuntuforums.org/showthread.php?t=1797848
# Collect DBUS_SESSION_BUS_ADDRESS from running process
function set_dbus_adress
{
USER=$1
PROCESS=$2
PID=`pgrep -o -u $USER $PROCESS`
@bencevans
bencevans / Emoticons.txt
Created July 4, 2013 14:41
FB Emoticons
smile
:-)
frown
:-(
tongue
:-P
grin
:-D
gasp
:-O
var child_process = require('child_process');
var LineInputStream = require('line-input-stream');
var sensorex = LineInputStream(child_process.spawn('./sensorex'));
sensorex.setEncoding("utf8");
sensorex.setDelimiter("\n");
sensorex.on('line', function(line) {
console.log('New Line: ' + line);
@bencevans
bencevans / 0_reuse_code.js
Created September 27, 2013 02:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Ubuntu Docker PostgreSQL How-To

How to use [zaiste/postgresql][1] Docker container.

Docker >= 0.5.0 required.

sudo docker pull zaiste/postgresql
@bencevans
bencevans / dabblet.css
Created December 5, 2013 19:12
Untitled
html, body {
margin: 0;
height: 100%;
padding: 0;
font-size: 30px;
}
.container {
width: 80%;
text-align: center;
margin: auto;
@bencevans
bencevans / clean-ignored.sh
Created December 31, 2015 11:18
clean ignored
while read p; do
git rm -r --cached $p
done < .gitignore
@bencevans
bencevans / lpk25.js
Created January 22, 2016 18:08
AKAI LPK25 Keyboard Events
const midi = require('midi')
var input = new midi.input()
input.getPortCount()
input.getPortName(0)
input.on('message', function (deltaTime, message) {