- ⇧: Shift
- ⌘: Command
- ⌃: Control
- ⌥: Alt/Option
- →: Right cursor
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
<script type="text/javascript"> | |
(function () { | |
"use strict"; | |
// once cached, the css file is stored on the client forever unless | |
// the URL below is changed. Any change will invalidate the cache | |
var css_href = './index_files/web-fonts.css'; | |
// a simple event handler wrapper | |
function on(el, ev, callback) { | |
if (el.addEventListener) { | |
el.addEventListener(ev, callback, 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
#!/usr/bin/env python | |
from sys import argv | |
if len(argv) != 2: | |
print('usage: %s filename.kv' % argv[0]) | |
exit(1) | |
from kivy.lang import Builder | |
from kivy.app import App |
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
/* | |
UPDATE July 2016 , moved and updated to here: https://github.com/Sumbera/gLayers.Leaflet | |
Generic Canvas Overlay for leaflet, | |
Stanislav Sumbera, April , 2014 | |
- added userDrawFunc that is called when Canvas need to be redrawn | |
- added few useful params fro userDrawFunc callback | |
- fixed resize map bug | |
inspired & portions taken from : https://github.com/Leaflet/Leaflet.heat |
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 asyncio | |
import tornado.concurrent | |
import tornado.ioloop | |
import tornado.web | |
import tornado.platform.asyncio | |
import tornado.httpclient | |
class ReqHandler(tornado.web.RequestHandler): | |
async def get(self): |
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
// Live video stream management for HTML5 video. Uses FFMPEG to connect to H.264 camera stream, | |
// Camera stream is remuxed to a MP4 stream for HTML5 video compatibility and segments are recorded for later playback | |
var liveStream = function (req, resp) { // handle each client request by instantiating a new FFMPEG instance | |
// For live streaming, create a fragmented MP4 file with empty moov (no seeking possible). | |
var reqUrl = url.parse(req.url, true) | |
var cameraName = typeof reqUrl.pathname === "string" ? reqUrl.pathname.substring(1) : undefined; | |
if (cameraName) { | |
try { | |
cameraName = decodeURIComponent(cameraName); |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
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
/* | |
Include this after bootstrap.css | |
Add a class of 'col-xs-offset-*' and | |
if you want to disable the offset at a larger size add in 'col-*-offset-0' | |
Examples: | |
All display sizes (xs,sm,md,lg) have an offset of 1 | |
<div class="col-xs-11 col-xs-offset-1 col-sm-3"> |
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
# run this as root | |
while [ 1 ]; do echo | nc -l -U /tmp/reload_nginx && /etc/init.d/nginx reload; done | |
# or as an upstart job | |
script | |
echo | nc -l -U /tmp/reload_nginx && /etc/init.d/nginx reload | |
end script | |
respawn | |
# now any process can run this or do the equivalent with sockets to trigger reload |
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 casper = require('casper').create(); | |
var utils = require('utils'); | |
var phpMyAdminUrl = casper.cli.args[0]; | |
var phpMyAdminCredentials = { | |
pma_username: casper.cli.options.user, | |
pma_password: casper.cli.options.password | |
}; | |
if (!phpMyAdminUrl || !phpMyAdminCredentials.pma_username || !phpMyAdminCredentials.pma_password) { | |
casper.echo('Invalid parameters. Usage: casperjs monitor_slave.js http://example.com/phpMyAdmin --user=foo --password=bar'); |