Skip to content

Instantly share code, notes, and snippets.

@NicholasMurray
NicholasMurray / AngularJS Geolocation Directive Jasmine Geolocation Available Test
Created February 18, 2015 23:27
AngularJS Geolocation Directive Jasmine Geolocation Available Test
describe('Directive tests: geolocation ', function() {
var $window, navigator;
describe('when called on a browser that has geolocation available ', function() {
beforeEach(module('geolocationApp'));
beforeEach(inject(function($rootScope, $compile, _$window_) {
element = angular.element('<geolocation class="geolocation"><p>This is a geolocation app</p></geolocation>');
@kachayev
kachayev / concurrency-in-go.md
Last active May 4, 2025 05:48
Channels Are Not Enough or Why Pipelining Is Not That Easy
#!/bin/bash
JQPATH=$(which jq)
if [ "x$JQPATH" == "x" ]; then
echo "Couldn't find jq executable." 1>&2
exit 2
fi
set -eu
shopt -s nullglob
#!/bin/bash
# apt-get install jq
#set -eu
shopt -s nullglob
readonly base_dir=$1
if [ -z "$base_dir" ] ; then
echo 'please location docker registry store location!';
exit;
fi
@umidjons
umidjons / angular-compile-dynamic-html.md
Created August 12, 2014 05:14
Compile dynamic template from outside of angular.

Compile dynamic template from outside of angular

I want to load dynamic HTML content via AJAX, then compile it, because it contains angular directives.

<!DOCTYPE html>
<html ng-app="app">
<head>
@jessitron
jessitron / haskellyte.md
Created August 1, 2014 16:12
Gershom's Letter to a Young Haskell Enthusiast, condensed. I removed a lot of words, kept the themes, moved a few around a bit.

Letter to a Young Haskell Enthusiast, by Gershom Bazerman.

Condensed from: http://comonad.com/reader/2014/letter-to-a-young-haskell-enthusiast/

The following letter is about tendencies that come with the flush of excitement of learning any new thing. It is written specifically, because if we don't talk specifics, the generalities make no sense. It is a letter full of things I want to remember.

You’ve entered the world of strongly typed functional programming, and it is great. You want to share the great things you’ve learned, and you want to slay all the false statements in the world.

@staltz
staltz / introrx.md
Last active June 8, 2025 22:15
The introduction to Reactive Programming you've been missing
@bjaglin
bjaglin / remove-orphan-images.sh
Last active March 31, 2024 22:54
Remove orphan layers left by the "file" storage backend of the docker registry, heavily inspired by https://gist.github.com/shepmaster/53939af82a51e3aa0cd6
#!/bin/bash
set -eu
shopt -s nullglob
readonly base_dir=/var/lib/docker/registry
readonly output_dir=$(mktemp -d -t trace-images-XXXX)
readonly jq=/usr/bin/jq
readonly repository_dir=$base_dir/repositories
#!/bin/bash
set -eu
shopt -s nullglob
readonly base_dir=/var/local/docker-registry
readonly output_dir=$(mktemp -d -t trace-images-XXXX)
readonly jq=/tmp/jq
readonly repository_dir=$base_dir/repositories
require 'set'
GEM_FILE_TO_PROCESS = "Gemfile.lock"
def gem_list_finished?(line)
line.include?("PLATFORMS")
end
def non_gem_line?(line)
line.include?("GEM") ||