This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parseInputs(data) { | |
var ret = {}; | |
retloop: | |
for (var input in data) { | |
var val = data[input]; | |
var parts = input.split('['); | |
var last = ret; | |
for (var i in parts) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pcl2pdf() { | |
input=$1 | |
output=${2-$input.pdf} | |
pcl6 -o $output -sDEVICE=pdfwrite $input | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
// Requirements: | |
// sudo apt-get install php5-cli php-pear libyaml-dev | |
// sudo pecl install yaml | |
$file = $_SERVER['HOME'] . '/.config/sflphone/sflphoned.yml'; | |
$acct_id = get_account_id($file); | |
$call_to = preg_replace('/[^0-9]/', '', $argv[1]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/** | |
* Help from: | |
* http://stackoverflow.com/questions/1821811/how-to-read-write-from-to-file | |
* https://groups.google.com/forum/#!topic/golang-nuts/1mc64pj_S50 | |
* http://pastebin.com/DgurHbpe | |
**/ | |
import ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Implementation | |
function iterate($original) | |
{ | |
$board = $original; | |
for ($x = 0; $x < count($board); $x++) { | |
$row = $board[$x]; | |
for ($y = 0; $y < count($row); $y++) { | |
$cell = $row[$y]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::before(function($request) | |
{ | |
// determine the subdomain of the current request | |
$server = explode('.', Request::server('HTTP_HOST')); | |
$sansSubdomain = implode('.', array_slice($server, 1)); | |
// there are 3 parts to the domain (i.e. user.domain.com) | |
if (count($server) == 3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Generator { | |
protected $namespaces = []; | |
protected $outputDirectoriesPSR4 = []; | |
protected $aliasMapTypes = []; | |
protected $inputFiles = []; | |
/* | |
* Methods to setup the data we need to generate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^(\d*)(\.(\d{0,2})?)?$/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
brew tap | while read tap; | |
do | |
echo "brew tap $tap" | |
done | |
brew list | while read formula; | |
do | |
options=$(brew info --json=v1 $formula | jq '.[0] .installed | sort_by(.version) [0] .used_options | join(" ")' -r) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.cpp | |
// Test libCEC | |
// | |
// Created by Ryan Sullivan on 10/26/15. | |
// Copyright © 2015 Ryan Sullivan. All rights reserved. | |
// | |
#import <iostream> | |
#import <cec.h> |