Skip to content

Instantly share code, notes, and snippets.

View benubois's full-sized avatar

Ben Ubois benubois

View GitHub Profile
@benubois
benubois / .tm_properties
Created December 19, 2011 18:38
tm_properties
#-------------------------------------------------------------------------------
# Drawer
#-------------------------------------------------------------------------------
myExtraIncludes = ".tm_properties,.htaccess,.gitignore"
fileBrowserGlob = "{*,$myExtraIncludes}"
include = "{$include,$myExtraIncludes}"
#-------------------------------------------------------------------------------
# Search
#-------------------------------------------------------------------------------
@benubois
benubois / class.validator.php
Created November 5, 2010 02:21
Validator: PHP Form Validation
<?php
/**
* Validate
*/
class Validator
{
/**
* form validation rules and options
*
@benubois
benubois / populate.js
Created November 5, 2010 02:19
Populate: JavaScript form field populator
var fields = {
'email': {
'value': 'example@example.com',
'aka': ['email', 'email_address', 'emailAddress']
},
'first_name': {
'value': 'First Name',
'aka': ['first_name', 'firstName', 'first', 'firstname']
},
'last_name': {
// Simulate a click event on the matched id
HTMLElement.prototype.click = function()
{
var evt = this.ownerDocument.createEvent('MouseEvents');
evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
this.dispatchEvent(evt);
}
document.getElementById("id").click();
# convert video to mp4
for f in "$@"
do
/usr/local/bin/HandBrakeCLI -i "$f" -o "$f.mp4" --preset="iPhone / iPod Touch" --longest -b 256
done
#!/usr/bin/env ruby
# Block sort in ruby
content = STDIN.read
lines = content.split(/\n\n+/).sort
lines.each { |line| puts line + "\n\n" }
!#/usr/bin/php
<?php
# Username
$username = '';
# Location of waves.txt file
$waves_txt = '';
# Private key. Optional if you want to include private bookmarks
$private_key = '';