Skip to content

Instantly share code, notes, and snippets.

View mcblum's full-sized avatar

Matt Blum mcblum

View GitHub Profile
@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);
@peterbsmyth
peterbsmyth / recipe.example.md
Last active May 21, 2020 13:39
Making chained API Calls using @ngrx/Effects

Making chained API Calls using @ngrx/Effects

Purpose

This recipe is useful for cooking up chained API calls as a result of a single action.

Description

In the below example, a single action called POST_REPO is dispatched and it's intention is to create a new repostiory on GitHub then update the README with new data after it is created.
For this to happen there are 4 API calls necessary to the GitHub API:

  1. POST a new repostiry
  2. GET the master branch of the new repository
  3. GET the files on the master branch
@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;
@isogram
isogram / wkhtmltopdf_wkhtmltoimage.md
Created April 8, 2016 09:50
How to manually install Wktohtmlpdf and Wkhtmltoimage in Ubuntu Server

How to Install Wkhtmltopdf and Wkhtmltoimage in Ubuntu

wget http://download.gna.org/wkhtmltopdf/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
tar -xvf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz
cd wkhtmltox/bin/
sudo mv wkhtmltopdf  /usr/bin/wkhtmltopdf
sudo mv wkhtmltoimage  /usr/bin/wkhtmltoimage
@alexweissman
alexweissman / README.md
Last active January 23, 2021 18:18
Migrating email accounts from a cPanel hosting environment to Mail-in-a-Box

Migrating email accounts from a cPanel hosting environment to Mail-in-a-Box

Part 1: Pregame

  1. Send a mass email to all of your account holders, letting them know that you will be migrating their email accounts to a new server. Send them the instructions from MiaB control panel for connecting to your MiaB server from their mobile/Outlook/Gmail/etc, if applicable. Also, send them a link to the new webmail address. Be sure to give adequate advanced notice (several days, if possible). Advise them to not change their passwords during this time (their passwords will be preserved during migration).
  2. Create a new "test" email account in the MiaB control panel for your domain. This will let MiaB set up the DNS records needed for the domain.

Part 2: Copy credentials

Copy the email account credentials from your cPanel host to MiaB:

@DanielMarklund
DanielMarklund / gist:3415529
Created August 21, 2012 13:39
Laravel - Navigation Active Class
<!-- Example on how to set class="active" on active navigation links -->
<!-- These links will always be visible -->
<li class="{{ URI::is( 'home') ? 'active' : '' }}">
<a href="{{ URL::to( 'home') }}">
Home
</a>
</li>
<li class="{{ URI::is( 'gallery') ? 'active' : '' }}">
@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];
@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
#
@brunogaspar
brunogaspar / README.md
Last active October 7, 2022 09:08
Install wkhtmltopdf on Ubuntu (14.04 64-bit) or (16.04 64-bit)

Install wkhtmltopdf on Ubuntu

This was tested on:

  • Ubuntu 14.04 x64
  • Ubuntu 16.04 x64

Installation

@javierarques
javierarques / protractorAPICheatsheet.md
Last active January 31, 2023 08:51
Protractor API Cheatsheet