Skip to content

Instantly share code, notes, and snippets.


Tim Hobbs timhobbs

View GitHub Profile
rossholdway / activated-route-stub.ts
Last active May 19, 2020
Stub Angular 2+ routers activatedRoute.
View activated-route-stub.ts
import {
} from '@angular/router';
import { ReplaySubject } from 'rxjs';
lansana / infinite-scroll.directive.ts
Last active Feb 9, 2021
This is an Angular 2 infinite scroll directive. It is simple, easy to use and very CPU-efficient.
View infinite-scroll.directive.ts
// When you attach the infiniteScroll directive to an element, it will emit the infiniteScrollAction
// @Output() event every time the user has scrolled to the bottom of the element. Your loadMoreArticles
// function can make an HTTP call and append the results to the articles list, for example. In doing this,
// you effectively increase the height of the element and thus begin the process of the infiniteScroll directive
// again, over and over until the element height stops increasing.
// <div class="container" infiniteScroll (infiniteScrollAction)="loadMoreArticles()">
// <div class="article" *ngFor="let article of articles">
benjamincharity / mockActivatedRoute.ts
Created Apr 12, 2017
Mock ActivatedRoute with params, data and snapshot.
View mockActivatedRoute.ts
beforeEach(async(() => {
imports: [
providers: [
provide: Router,
useClass: MockRouter,
c9s / .babelrc
Last active Feb 20, 2021
webpack + babel + typescript + es6 - total solutions!
View .babelrc
"presets": ["es2015"],
"plugins": ["transform-runtime"]
gabonator / api.txt
Created Jan 16, 2016
tvheadend json api calls for version 4.0.8
View api.txt
{"sw_version": "4.0.8~wheezy","api_version": 15,"name": "Tvheadend","capabilities": ["caclient","tvadapters","satip_client","satip_server","trace"]}
- returns tv listings guilde
- returns list of all tv/radio channels
{"entries":[ {"key": "8da5751f0c30fc8317d7d5875ce87bd4","val": "Markiza"}, ... }
benlinton /
Last active Feb 3, 2021
Multiple MySQL Versions with Homebrew

Multiple MySQL Versions for Development

Options included below:

  • Using Docker docker-compose
  • Using Homebrew brew

Using Docker (recommended)

This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.

tegansnyder / disable mcafee endpoint
Last active Feb 16, 2021
Disable McAffee Endpoint Protection OSX
View disable mcafee endpoint

method 1

sudo /usr/local/McAfee/AntiMalware/VSControl stopoas


sudo defaults write /Library/Preferences/com.mcafee.ssm.antimalware.plist OAS_Enable -bool False
sudo /usr/local/McAfee/AntiMalware/VSControl stop
sudo /usr/local/McAfee/AntiMalware/VSControl reload
View 1-restify-server-cheatsheet.js
// Restify Server CheatSheet.
// More about the API:
// Install restify with npm install restify
// 1.1. Creating a Server.
var restify = require('restify');
lttlrck / gist:9628955
Created Mar 18, 2014
rename git branch locally and remotely
View gist:9628955
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
DanHerbert /
Last active Feb 26, 2021
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

READ THIS Very Important Update

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.