Skip to content

Instantly share code, notes, and snippets.

View amad's full-sized avatar
🚀
(⌐■_■)

Ahmad Samiei amad

🚀
(⌐■_■)
View GitHub Profile
<?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());
$ 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
/**
* _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');
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';
}
@amad
amad / .vimrc
Created April 20, 2014 19:57 — forked from JeffreyWay/.vimrc
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
<?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)
//

We are testing a simple controller from imaginable MVC framework.

<?php
class UserController extends AbtractController {

    public function show($id)
    {
        $user = $this->db->find('users',$id);
        if (!$user) return $this->render404('User not found');
@font-face{
font-family:"Museo 100";
font-weight:normal;
font-style:normal;
src:url("data:application/x-font-woff;
charset=utf-8;
base64,d09GRgABAAAAAGZ0ABMAAAAAvcQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABqAAAABwAAAAcXnt9LEdERUYAAAHEAAAALQAAADIC+wHsR1BPUwAAAfQAAAAgAAAAIGyRdI9HU1VCAAACFAAAAOcAAAGmYzVg9E9TLzIAAAL8AAAAUQAAAGCOTYuqY21hcAAAA1AAAAGZAAAB+tKuiJRjdnQgAAAE7AAAADAAAAAwCTsMh2ZwZ20AAAUcAAABsQAAAmVTtC+nZ2FzcAAABtAAAAAIAAAACAAAABBnbHlmAAAG2AAAVvAAAKeg085XJ2hlYWQAAF3IAAAAMwAAADYDQhPsaGhlYQAAXfwAAAAgAAAAJA6KBvNobXR4AABeHAAAAkMAAAOcxmhNf2xvY2EAAGBgAAABxAAAAdD8FycgbWF4cAAAYiQAAAAgAAAAIAIEAaNuYW1lAABiRAAAAXwAAAPCXG2H/3Bvc3QAAGPAAAAB5wAAAteGw2eqcHJlcAAAZagAAADEAAABRbzOliN3ZWJmAABmbAAAAAYAAAAGKzpSHQAAAAEAAAAAzD2izwAAAADD+v6jAAAAAM5C27l42mNgZGBg4ANiLQYQYGJgYWBkqALiaoZaIK+O4RGQ/ZjhGVgGJM8AAF3ZBOgAAAAAAQAAAAoAHAAeAAFsYXRuAAgABAAAAAD//wAAAAAAAHjatZDNSkJRFIW/c/1BLiIhmuAgHDkQEXVSryAIGqJk6OBiGMFFouusepWeoWFq+CxB5mvouoeDo6YO9lqbffZee+2DAXyqPGDCYLkgQ1IVDgdSIoNHQpXU/CWYUQmfHgOqURAuqUdRs0Vb2ObGdiYtYtG42RgTUspS4EpbGq6rR
function fish_prompt
if not set -q -g __fish_robbyrussell_functions_defined
set -g __fish_robbyrussell_functions_defined
function _git_branch_name
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end
function _is_git_dirty
echo (git status -s --ignore-submodules=dirty ^/dev/null)
# to find out the configuration commands, run: h2o --help
user: www-data
hosts:
"example.com":
listen:
host: xx.xx.xx.xx
port: 443