Skip to content

Instantly share code, notes, and snippets.

View thekarel's full-sized avatar

Charles Szilagyi thekarel

View GitHub Profile
protractor example/conf.js --no-jasmineNodeOpts.showColors
For NON DebUbuntu: "Thanks for sharing this - it was a good start in the right direction for me. I noticed that start-stop-daemon appears to be Debian-specific. I modified it to simply execute $XVFB in the background with '&', capture the pid with $!, and echo'ed it to $PIDFILE, then used killproc -p $PIDFILE $XVFB in the stop handler and it is working for me under CentOS that way. If anybody cares to try that, make sure to import /etc/init.d/functions with the '.' at the beginning to get the killproc function."
#!/bin/bash
# TODO: http://wiki.debian.org/LSBInitScripts
DESC="Selenium server"
RUN_AS=root
JAVA_BIN=/usr/bin/java
SELENIUM_DIR=/etc/selenium
PID_FILE="$SELENIUM_DIR/selenium.pid"
@thekarel
thekarel / ngOptions.html
Created December 12, 2013 16:37
ngOptions for an array of objects
var titles = [
{title: 'Mr'},
{title: 'Dr'}
];
<select ng-options="t.title for t in titles track by t.title">
// Fix up prefixing
window.AudioContext = window.AudioContext || window.webkitAudioContext;
var context = new AudioContext();
function playSound(buffer) {
var source = context.createBufferSource(); // creates a sound source
source.buffer = buffer; // tell the source which sound to play
source.connect(context.destination); // connect the source to the context's destination (the speakers)
source.start(0); // play the source now
// note: on older systems, may have to use deprecated noteOn(time);
var RhythmSample = {
};
RhythmSample.play = function() {
function playSound(buffer, time) {
var source = context.createBufferSource();
source.buffer = buffer;
source.connect(context.destination);
if (!source.start)
source.start = source.noteOn;
console.log('\033[2J');
//This works on linux. Not sure about windows.
// You can "trick" the user using something like this:
var lines = process.stdout.getWindowSize()[1];
for(var i = 0; i < lines; i++) {
console.log('\r\n');
}
Object.keys(myArray).length
@thekarel
thekarel / consolesize.js
Created December 31, 2013 15:44
Get console size in Node.js
console.log(process.stdout.columns);
console.log(process.stdout.rows);
console.log(process.stdout.getWindowSize());
@font-face {
font-family: 'MyWebFont';
src: url('webfont.eot'); /* IE9 Compat Modes */
src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('webfont.woff') format('woff'), /* Modern Browsers */
url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}