Skip to content

Instantly share code, notes, and snippets.

@Arwid
Arwid / get-watchers.js
Last active August 29, 2015 14:27 — forked from kentcdodds/get-watchers.js
Get Watchers of element and its children
function getWatchers(root) {
root = angular.element(root || document.documentElement);
var watcherCount = 0;
function getElemWatchers(element) {
var isolateWatchers = getWatchersFromScope(element.data().$isolateScope);
var scopeWatchers = getWatchersFromScope(element.data().$scope);
var watchers = scopeWatchers.concat(isolateWatchers);
angular.forEach(element.children(), function (childElement) {
watchers = watchers.concat(getElemWatchers(angular.element(childElement)));
@Arwid
Arwid / recompileOn.js
Last active August 29, 2015 14:27
AngularJS RecompileOn Directive
// Forked from: https://medium.com/@kentcdodds/angularjs-one-time-bindings-and-recompiling-templates-9857b2cead01
/* global angular */
var directives = angular.module('directives');
directives.directive('recompileOn', ['$parse', function($parse) {
'use strict';
return {
transclude: true,
link: function link(scope, $el, attrs, ctrls, transclude) {
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@Arwid
Arwid / migrations.js
Created June 20, 2017 21:46 — forked from vincentbernat/migrations.js
Test database migration result with Sequelize.js
'use strict';
var setup = require('../.'),
should = require('should'),
path = require('path'),
Sequelize = require('sequelize'),
db = require('../../lib/db'),
config = require('../../lib/config'),
logger = require('../../lib/logger');
_ = require "lodash"
DEFAULT_OPTIONS =
filter: /_/
silent: false
camelize = (obj, options) ->
options = _.merge {}, DEFAULT_OPTIONS, options
methodNames = _
@Arwid
Arwid / flowsensortest.py
Created June 15, 2018 15:35
FlowSensorTest
#!/usr/bin/python
# Originally From: https://www.raspberrypi.org/forums/viewtopic.php?t=118230
import RPi.GPIO as GPIO
import time, sys
import datetime
FLOW_SENSOR = 17
GPIO.setmode(GPIO.BCM)