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
// Check if url includes #/ | |
if(window.location.hash.length < 1 || window.location.hash == ''){ | |
window.location = window.location.origin + window.location.pathname + '#/' + window.location.search; | |
} |
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
# start_time="$(date +%s)" | |
# Antigen — A zsh plugin manager | |
export ANTIGEN_DEFAULT_REPO_URL=https://github.com/sharat87/oh-my-zsh.git | |
source ~/antigen.zsh | |
# Load the oh-my-zsh's library. | |
antigen use oh-my-zsh | |
# Bundles from the default repo declared above. |
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 | |
/** | |
* Calculate the elapsed time between two timestamps | |
* and display in a pretty human way. | |
* @param integer $start Initial timestamp | |
* @param integer $end Final timestamp, set to -1 for current time. | |
* @return string Formatted elapsed time. | |
*/ | |
function timeBetween($start, $end=-1){ | |
if($end < 0) $end = time(); |
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 image proxy for Nodejs | |
* @param {Express} app Express app | |
* @return {function} | |
*/ | |
var http = require('http'), | |
url = require('url'); | |
module.exports = function (app) { | |
app.get('/proxy/:image', function (request_from_client, response_to_client) { |
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 getAge($birth){ | |
$t = time(); | |
$age = ($birth < 0) ? ( $t ($birth * -1) ) : $t - $birth; | |
return floor($age/31536000); | |
} |
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 | |
include('displayFiles.php'); | |
displayFiles('pictures'); |
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
<script type="text/javascript"> | |
$('.drag').bind('click',function(){ bringFront($(this), '.drag'); }); | |
</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
// Match all the paths you are interested in, store them as p | |
// then set n.property to the appropriate value. | |
// the final 1 means how many nodes with that property/value you want in the paths | |
MATCH p=(c)-[:REL_TYPE*]-(n) | |
WHERE LENGTH(FILTER(n IN EXTRACT(n IN nodes(p) | n) WHERE n.property = "value"))=1 | |
RETURN DISTINCT n |
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
@ECHO OFF | |
ECHO Launching Emulator | |
ECHO Using AVD: AVD_for_4_WVGA_Nexus_S | |
emulator -avd "AVD_for_4_WVGA_Nexus_S" -verbose -http-proxy "http://20.42.128.36:8080" -netfast -gpu on -no-boot-anim -noaudio | |
PAUSE |
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 print_json($json) { | |
if (is_array($json) || is_object($json)) { | |
echo "<table width=100%>"; | |
$type = 'Array'; | |
if(is_object($json)) $type = 'Object'; | |
echo '<tr><td colspan=2 style="background-color:#333333;"> | |
<strong><font color=white>'.$type.'</font></strong> | |
</td></tr>'; | |
foreach ($json as $k => $v) { |