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
navigator.geolocation.getCurrentPosition(function(pos) { | |
var coords = pos.coords; | |
Pebble.showSimpleNotificationOnPebble('Hello!', | |
'Your coordinates are ' + coords.latitude + ', ' + coords.longitude); | |
)} |
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; | |
root #replace this with the default full path to where all of your PHP files are; | |
index home; | |
server_name www.jumalabs.com #change to desired name, such as flipquiz.jumalabs.com; | |
location / { | |
rewrite ^/(.*)$ /index.php?url=$1 break; |
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
function convertAnswerNumberToLetters($number){ | |
$LETTERS_DICTIONARY = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'); | |
$MAX_ITERATIONS = 20; | |
$letters = ''; | |
$numIterations = 0; | |
while($number > 0 && $numIterations <= $MAX_ITERATIONS){ | |
$index = $number; | |
for($temp = 0; $temp < $MAX_ITERATIONS && $temp < $number && $temp > 26; $temp -= 26){ |
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
ssh -p remotePort -D localPort -C -q -N user@remoteHost |
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 | |
function sigmoid($t){ | |
return 1 / (1 + pow(M_EULER, -$t)); | |
} | |
?> |
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
import sys | |
#open hosts file and read current data | |
hostsFile = open("/etc/hosts", "w+") | |
hostsFileData = hostsFile.read() | |
#host list | |
newHosts = [ | |
"facebook.com", | |
"quora.com", |
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 | |
/** | |
* JSMin.php - modified PHP implementation of Douglas Crockford's JSMin. | |
* | |
* <code> | |
* $minifiedJs = JSMin::minify($js); | |
* </code> | |
* | |
* This is a modified port of jsmin.c. Improvements: | |
* |
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 | |
/* require JSMin class file */ | |
require_once('JSMin.class.php'); | |
class minifier{ | |
function __Construct(){ | |
} | |
function minifyCSS($CSS) { | |
/* remove comments */ | |
$CSS = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $CSS); |
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
/* Global */ | |
*{padding:0px; margin:0; border:none; outline:none; color:#333; font-family:Arial,Helvetica,sans-serif;} | |
*:focus{border:none; outline:none;} | |
html,body{height:100%;} | |
h1{font-size:32px !important;} | |
h2{font-size:24px !important;} | |
h3{font-size:19px !important;} | |
h4{font-size:16px !important;} | |
h5{font-size:13px !important;} | |
h6{font-size:11px !important;} |