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 | |
# -*- coding: utf8 -*- | |
# | |
# Read humidity and temperature from DHT11 sensor connected to RaspberryPi. | |
# | |
# DHT11 protocol depends on exact timing. Sometimes linux kernel may evict your | |
# process, or GC can cause program to miss some of a bits from transmission. In | |
# that case following application will raise an error and you can try to run it | |
# again | |
# |
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
/** | |
* Web application debug proxy server. | |
* | |
* It is suited for hosting uncompressed sources of front-end assets and proxy dynamic | |
* requests to servers preparing data. I find similar setup also useful for investigating | |
* issues on production servers by going through the proxy, which use local unminified | |
* JS and CSS on top of production html pages. | |
* | |
* To run following example you will need to have http-proxy, express and send packages installed. | |
* |
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
/** | |
* To run it you will need to install | |
* | |
* $ npm install http-proxy | |
*/ | |
var http = require('http'), | |
httpProxy = require('http-proxy'), | |
port = 3001, | |
proxiedHost = 'localhost', |
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
/** | |
* Mouse wheel polyfill inspired by cross-browser example on mdn wiki. | |
* | |
* It supports relatively modern browsers, which already support addEventListener and Array forEach methods. | |
* Effectively it is targeting webkit based browsers. I didn't have opportunity to test it on old Firefox. | |
* Method addEventListener is supported in IE9, which already supports wheel event. I guess one could combine | |
* it with polyfill for addEventListener to have support in IE 6-8. In that case one would have to also wrap | |
* all addEventListener methods provided by the polyfill (last block below). | |
* | |
* @see https://developer.mozilla.org/en-US/docs/Web/Reference/Events/wheel?redirectlocale=en-US&redirectslug=DOM%2FMozilla_event_reference%2Fwheel#Listening_to_this_event_across_browser |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
;; Define various js test/linting compilation errrors matchers. You can say, | |
;; which you want to consider on matching output from compilation, by | |
;; customizing compilation-error-regexp-alist variable. | |
;; | |
;; (setq compilation-error-regexp-alist (list 'jstestdriver 'jslint-file 'jslint-line)) | |
;; | |
;; If you are using desktop.el, you may want to keep compilation customizations | |
;; in your project deskto file | |
;; | |
;; (add-to-list 'desktop-globals-to-save 'compilation-search-path) |
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 node | |
var server = require('./test-server'), | |
child_process = require('child_process'), | |
port = server.port; | |
console.log(''); | |
console.log('------------------------------------------------------------------------'); | |
console.log('Running jasmine tests in phantomjs'); |
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 node | |
var exec = require('child_process').exec, | |
mkdirp = require('mkdirp'), | |
projectPath = __dirname + '/../..', | |
targetPath = __dirname + '/../../target/assets'; | |
// Task execution helpers | |
// ---------------------- |