Skip to content

Instantly share code, notes, and snippets.

View mcblum's full-sized avatar

Matt Blum mcblum

View GitHub Profile
@praphull27
praphull27 / Jenkins_Protractor_Headless_Chrome_Setup_Ubuntu_14.04.md
Last active April 9, 2024 11:44
Jenkins, Protractor and Headless Chrome Browser Setup on Ubuntu 14.04

Jenkins, Protractor and Headless Chrome Browser Setup on Ubuntu 14.04

Update Ubuntu

sudo apt-get update
sudo apt-get upgrade

Install Java

@aike
aike / getUserMediaAudioMock.js
Created September 1, 2014 03:22
getUserMedia API mock for audio
// This program is licensed under the MIT License.
navigator.webkitGetUserMedia = function(opt, ok, ng) {
ok(null);
};
AudioContext.prototype.createMediaStreamSource = function() {
var osc = this.createOscillator();
osc.type = 'sine';
var gain = this.createGain();
gain.gain.value = 0.0;
osc.connect(gain);
@m-wild
m-wild / cloudflaredns.sh
Last active June 1, 2022 20:18 — forked from briped/gratisdns.sh
CloudFlare dynamic dns updater module for Synology
#!/bin/sh
# cloudflareddns.sh - dynamic dns updater module for Synology
#
# Author:
# Michael Wildman (http://mwild.me)
#
# Version:
# 0.2
#
@weberste
weberste / gist:354a3f0a9ea58e0ea0de
Last active January 28, 2022 13:47
Dates only with Angular-UI Bootstrap datepicker
app.directive('datepickerLocaldate', ['$parse', function ($parse) {
var directive = {
restrict: 'A',
require: ['ngModel'],
link: link
};
return directive;
function link(scope, element, attr, ctrls) {
var ngModelController = ctrls[0];
@h4cc
h4cc / restart_graylog2_services.sh
Created May 1, 2014 10:48
Commands needed to stop and restart all services in a Graylog2 server.
# Stop all services in needed order.
service graylog2-web stop; service graylog2-server stop; service elasticsearch stop; service mongodb stop;
# Start all services in needed order.
# - sleep is needed, so ES and Mongo have time to startup.
service elasticsearch start; service mongodb start; sleep 5; service graylog2-server start; service graylog2-web start;
#!/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/)
@demisx
demisx / angularjs-providers-explained.md
Last active March 17, 2024 11:09
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@erichurst
erichurst / US Zip Codes from 2013 Government Data
Created December 9, 2013 23:00
All US zip codes with their corresponding latitude and longitude coordinates. Comma delimited for your database goodness. Source: http://www.census.gov/geo/maps-data/data/gazetteer.html
This file has been truncated, but you can view the full file.
ZIP,LAT,LNG
00601,18.180555, -66.749961
00602,18.361945, -67.175597
00603,18.455183, -67.119887
00606,18.158345, -66.932911
00610,18.295366, -67.125135
00612,18.402253, -66.711397
00616,18.420412, -66.671979
00617,18.445147, -66.559696
@dr-dimitru
dr-dimitru / .htaccess
Created October 30, 2013 16:34
.htaccess file for Laravel 4 and Laravel 3 | For /public folder
# ----------------------------------------------------------------------
# /PUBLIC folder .htaccess
# ----------------------------------------------------------------------
# This .htaccess file is recommended
# to be placed at root/public folder
# of your Laravel powered application
# ----------------------------------------------------------------------
# This file works with Laravel 3 and 4
# ----------------------------------------------------------------------
# Turning on the rewrite engine is necessary for the following rules and