This file contains 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 queryStringReader = function (k) { | |
var args = {}; | |
var vals = []; | |
var i = 0 | |
if (location.search.length > 1) { | |
var query = location.search.substr(1); | |
i = 1; | |
if (location.search.indexOf("=") != -1) { |
This file contains 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
/* Javascript utility funcs */ | |
function valueInArray (val,arr) { | |
for (var i = 0; i < arr.length; i++) { | |
if (val==arr[i]) { | |
return true; | |
} | |
} | |
return false; |
This file contains 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 JSON JQUERY | |
Jquery | |
$.ajax( | |
{ | |
url:'json.php', | |
dataType:'json', /* tried jsonp only to get weird html error */ | |
type:'post', |
This file contains 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 XML to array | |
<?php | |
/* Usage | |
Grab some XML data, either from a file, URL, etc. however you want. Assume storage in $strYourXML; | |
$objXML = new xml2array(); |
This file contains 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 ims = (typeof window.ims == 'undefined') ? {} : window.ims; | |
var ims.myClass = function(args) { | |
var myPrivate1 = 'private 1'; | |
var myPrivate2 = 'private 2'; | |
var myPrivateMethod = function() { | |
return myPrivate1; | |
} |
This file contains 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
server { | |
listen 80; | |
server_name domain.com; | |
rewrite ^/(.*) http://www.domain.com/$1 permanent; | |
} | |
############# |
This file contains 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
Pull to web host | |
git init | |
git remote add origin git@github.com:username/domain.git . | |
git pull origin master | |
http://nvie.com/posts/a-successful-git-branching-model/ | |
branches: |
This file contains 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
$ch = curl_init('http://domain.com?'.http_build_query(array('type'=>'stuffIndex','request'=>'getIt'))); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$resp = curl_exec($ch); | |
curl_close($ch); | |
$d = json_decode($resp,true); | |
if ($d && isset($d['akey'])) { | |
} |
This file contains 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
$ch = curl_init($post_url); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_POST, 1); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('data1'=>'val','data2'=>'val2'))); | |
$data_str = curl_exec($ch); | |
curl_close($ch); | |
file_put_contents($path_to_xml_data,$data_str); |
OlderNewer