Skip to content

Instantly share code, notes, and snippets.

View marcelaraujo's full-sized avatar

Marcel Araujo marcelaraujo

View GitHub Profile
#!/usr/bin/env node
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
* Modified from https://gist.github.com/paolorossi/1993068
*/
var http = require('http')
, fs = require('fs')
, util = require('util')
@marcelaraujo
marcelaraujo / .eslintrc
Last active August 29, 2015 14:23 — forked from cletusw/.eslintrc
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@marcelaraujo
marcelaraujo / $logDecorator.js
Last active August 29, 2015 14:27
AngularJS - Disable logging
(function() {
var app = angular.module('myApp', []);
app.config(['$provide', function($provide) {
// decorates the $log instance to disable logging
$provide.decorator('$log', ['$delegate',
function($delegate) {
var $log, enabled = true;
$log = {
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
@marcelaraujo
marcelaraujo / osx-10.10-setup.md
Last active September 18, 2015 15:59 — forked from kevinelliott/osx-10.10-setup.md
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@marcelaraujo
marcelaraujo / gist:f25b5839d0617e591323
Created October 1, 2015 03:24 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan Developer Preview 2

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
(function () {
'use strict';
function PubSubService() {
var Topics = function () {
this.topics = {};
};
Topics.prototype.subscribe = function (topic, listener) {
@marcelaraujo
marcelaraujo / sinon-chai-expect.md
Created November 25, 2015 12:18 — forked from patocallaghan/sinon-chai-expect.md
Sinon Chai assertions in expect style.Examples from http://chaijs.com/plugins/sinon-chai #sinon #chai #javascript

Sinon JS

##Spies

//Anonymous function
var spy = sinon.spy();

//Provided Function
var spy = sinon.spy(myFunc);
@marcelaraujo
marcelaraujo / chai-expect.md
Created November 25, 2015 12:19 — forked from patocallaghan/chai-expect.md
Chai Expect Assertion library examples. From http://chaijs.com/api/bdd/ #chai #javascript #expect

##Chai Expect

##Language Chains

  • to
  • be
  • been
  • is
  • that
  • and
  • have