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 | |
// Variables used in this script: | |
// $summary - text title of the event | |
// $datestart - the starting date (in seconds since unix epoch) | |
// $dateend - the ending date (in seconds since unix epoch) | |
// $address - the event's address | |
// $uri - the URL of the event (add http://) | |
// $description - text description of the event | |
// $filename - the name of this file for saving (e.g. my-event-name.ics) | |
// |
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
set nocompatible " Disable vi-compatibility | |
set t_Co=256 | |
colorscheme xoria256 | |
set guifont=menlo\ for\ powerline:h16 | |
set guioptions-=T " Removes top toolbar | |
set guioptions-=r " Removes right hand scroll bar | |
set go-=L " Removes left hand scroll bar | |
set linespace=15 |
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
window.addEventListener('devicelight', function(e) { | |
var lux = e.value; | |
document.querySelector('#result').textContent = lux + ' lux'; | |
if(lux < 50) { | |
document.body.className = 'dim'; | |
} | |
if(lux >= 50 && lux <= 1000) { | |
document.body.className = 'normal'; | |
} |
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
/** | |
* _demonlib.php | |
*/ | |
defined('DEAMON_LOCK_FILE') || | |
define('DEAMON_LOCK_FILE', 'run/deamon.pid'); | |
if($_SERVER['argc'] >= 2 && $_SERVER['argv'][1] == 'kill') | |
{ | |
$fh = fopen(realpath(__DIR__) . '/' . DEAMON_LOCK_FILE, '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
$ stty -F /dev/ttyACM0 cs8 9600 ignbrk -brkint -imaxbel -opost -onlcr -isig\ | |
-icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts | |
$ screen /dev/ttyACM0 9600 | |
<?php | |
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 | |
// Turn off output buffering | |
ini_set('output_buffering', 'off'); | |
// Turn off PHP output compression | |
ini_set('zlib.output_compression', false); | |
//Flush (send) the output buffer and turn off output buffering | |
while (@ob_end_flush()); | |
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
window.onbeforeunload = function() { return "Message"; }; |
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
setlocale(LC_ALL, 'en_US.UTF8'); | |
function toAscii($str, $replace=array(), $delimiter='-') { | |
if( !empty($replace) ) { | |
$str = str_replace((array)$replace, ' ', $str); | |
} | |
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $str); | |
$clean = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $clean); | |
$clean = strtolower(trim($clean, '-')); | |
$clean = preg_replace("/[\/_|+ -]+/", $delimiter, $clean); |
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 shutdown_find_exit() | |
{ | |
var_dump($GLOBALS['dbg_stack']); | |
} | |
register_shutdown_function('shutdown_find_exit'); | |
function write_dbg_stack() | |
{ | |
$GLOBALS['dbg_stack'] = debug_backtrace(); |
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 socket = io.connect('http://grid.moeinhm.ir:3000'); | |
var GridTask = new Worker('matrix.js'); | |
GridTask.postMessage('doIt'); | |
GridTask.onmessage = function(result){ | |
socket.emit('result',result); | |
GridTask.postMessage('doIt'); | |
}; | |
GridTask.onmessage(result); |