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 | |
function get_latlng ($address) | |
{ | |
// api key | |
$key = ''; | |
// maps geocode api request | |
$url = "https://maps.googleapis.com/maps/api/geocode/json"; | |
$query = "?address=" . urlencode($address) . "&sensor=false"; |
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 | |
return array( | |
'ignore' => array(), | |
'detail' => true, | |
'log' => true, | |
'logger' => function($exception) | |
{ | |
die($exception); | |
} |
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 | |
function sendsms($number, $message) | |
{ | |
$username = 'username'; | |
$password = 'password'; | |
//set POST variables | |
$url = 'http://bulksms.2way.co.za/eapi/submission/send_sms/2/2.0'; |
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 | |
namespace App; | |
// add key-value storage to models | |
class Eloquent extends \Eloquent { | |
protected $metaClass = 'ObjectMeta'; |
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 | |
function hex2rgb( $col ) { | |
if ( $col[0] == '#' ) { | |
$col = substr( $col, 1 ); | |
} | |
if (strlen( $col ) == 6) { | |
list( $r, $g, $b ) = array( $col[0] . $col[1], $col[2] . $col[3], $col[4] . $col[5] ); | |
} elseif (strlen( $col ) == 3) { | |
list( $r, $g, $b ) = array( $col[0] . $col[0], $col[1] . $col[1], $col[2] . $col[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
var people = ['Daniel', 'Dustin', 'David', 'Damarcus', 'Russ']; | |
function matchPeople(input) { | |
var regex = new RegExp('[' + input.split('').join(']+.*[') + ']+', 'ig'); | |
return people.filter(function(person) { | |
if (person.match(regex)) return person; | |
}); | |
} | |
console.log(matchPeople('dvd')); // returns ['David'] |
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
String.prototype.endsWith = function (str) { | |
if (this.substr(-str.length) === str) { | |
return true; | |
} | |
return false; | |
}; |
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
/** | |
* simple mustache-like templater | |
* http://mir.aculo.us/2011/03/09/little-helpers-a-tweet-sized-javascript-templating-engine/ | |
* ----------------------------------------------------------------------------------------- | |
* t('Hello, {{planet}}!', array('planet' => 'World'); | |
* returns 'Hello, World!'; | |
*/ | |
function t(s,d){ | |
for(var p in d) | |
s=s.replace(new RegExp('{{'+p+'}}','g'), d[p]); |
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
<!-- require --> | |
<script data-main="/js/main" src="/js/vendor/require-2.0.6.js"></script> | |
<!-- data --> | |
<script> | |
define('data', [], function () { | |
return <?= json_encode($bootstrap); ?>; | |
}); | |
</script> |
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
for dir in ~/knnktr/*; | |
do (cd $dir && git pull origin master); | |
done; |