Skip to content

Instantly share code, notes, and snippets.

View entomb's full-sized avatar

Jonathan Tavares entomb

View GitHub Profile
const __artists = {
A: [
'A Perfect Circle', 'a-ha',
'A.R. Rahman', 'Acid Bath',
'Acid King', 'Aerosmith',
'Alice In Chains', 'All Them Witches',
'Allman Brothers Band', 'Amenra',
'Amorphis', 'Anathema',
'Animals As Leaders', 'Annie Lennox',
'Annihilator', 'Anoushka Shankar',
@entomb
entomb / navigator.js
Created January 19, 2016 02:15
responsive page navigator widget, 2-way interaction (used by 8mpixels.com).
/*
$('<div>').attr('id','navigator').appendTo('body');
$('<div>').attr('id','navigator-handle').appendTo('#navigator');
#navigator-handle{
width:20px;
height:15px;
background:rgba(0,0,0,.2);
cursor:move;
position:relative;
@entomb
entomb / Vagrantfile
Created August 27, 2015 13:15
Vagrant file that doest suck (php5/mysql/apache + node)
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise32"
@entomb
entomb / numberPump.js
Created July 3, 2014 12:46
A small tool to pump numbers up (or down)
/**
* numberPump
* small tool to pump it up
* @author Joanthan Tavares
* @class numberPump
* @class numberPump
* @param options {object} pump this up
* @param options.from {Number} pump this up
* @param options.to {Number} untill it gets here
* @param options.element {DOMelement} if passed, the step will pe set on the .innerHTML or .value of this object
@entomb
entomb / gist:7375162
Created November 8, 2013 18:12
Cute loading icon for the title bar.
var cuteLoading = (function(){
//var sequence = "◑ ◓ ◐ ◒";
//var sequence = "◢ ◣ ◤ ◥";
//var sequence = "▁ ▂ ▃ ▄ ▅ ▆ ▇ █ ▇ ▆ ▅ ▄ ▃ ▂ ▁";
var sequence = "✴ ✷ ✶ ✸ ✹ ✺ ❁ ❂ ❁ ✺ ✹ ✶ ✷ ✴";
var cacheTitle;
var _timeout;
@entomb
entomb / php_arrayToXml.php
Created October 8, 2013 01:33
Parses an Array to XML, allows for multiple items with the same key, as long as the parent node is a collection. Useful for those nasty SOAP webservices with auto generated and poor WSDL
<?php
$request = array(
'Test' => array(
'innerTest' => array(
'innerInnerTest' => array(
'someVar' => 'ABCabcXYZxyz',
'arrayVar' => array(
'someString' => 'loremipsum',
'someInt' => 123123123,
@entomb
entomb / df.php
Last active December 22, 2015 19:59
PHP cron script to parse nix `df` commands and save its outputs into a mysql table. useful for mount usage logs on remote servers. Data can be then read and displayed as you like
<?php
/**
* PHP df command parser
*
* @author Jonathan Tavares
*/
/**
* MySQL Configuration
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE: