Skip to content

Instantly share code, notes, and snippets.

View sym3tri's full-sized avatar
🌴
On vacation

Ed Rooth sym3tri

🌴
On vacation
View GitHub Profile
angular.module('myServices')
.factory('visibilityBroadcaster', function($rootScope, $document, _) {
var document = $document[0],
features,
detectedFeature;
features = {
standard: {
eventName: 'visibilitychange',
@sym3tri
sym3tri / _.md
Created March 14, 2014 05:58
arc percent (incomplete)
alert();
@sym3tri
sym3tri / health-checker.go
Created January 22, 2015 02:35
simple go app to check the health of a url then do stuff if unhealthy
package main
import (
"flag"
"fmt"
"log"
"net/http"
"os"
"time"
)
data:text/html, <textarea style="font-size: 1.2em; width: 100%; height: 100%; border: none; outline: none" autofocus></textarea><script>window.onbeforeunload = function(e) { return 'really close?'; };</script>
@sym3tri
sym3tri / Read from MongoDB slave.js
Created February 12, 2011 02:33
Read from a MongoDB replica set's slave node
db.getMongo().setSlaveOk()
@sym3tri
sym3tri / UrlRegex.js
Created June 2, 2011 10:24
Validate URLs with JavaScript Regex
/^(http(s)?:\/\/)?([\w-]+\.{1})*(([\w-]*){1}(\.{1}[A-Za-z]{2,4}){1}){1}(\:{1}\d*)?([\?\/|\#]+[\@\~\;\+\'\#\,\.\%\-\/\&\?\=\w\$\s]*)*$/i
@sym3tri
sym3tri / svg-spinner.js
Last active December 10, 2015 23:08
A pure svg spinner generated with d3. Play with this here: http://enjalot.com/inlet/4513075/
// tweak these options
var lineTotal = 16,
lineLength = 30,
speed = 1.28,
width = 1.96,
radius = 16,
color = '#333',
// dont touch these
posX = 100,
@sym3tri
sym3tri / _.md
Created January 11, 2013 19:03
pure svg spinner generator
@sym3tri
sym3tri / _.md
Created January 18, 2013 18:41 — forked from anonymous/config.json
An inlet to Tributary