Skip to content

Instantly share code, notes, and snippets.

View seanislegend's full-sized avatar
🚀

Sean McEmerson seanislegend

🚀
View GitHub Profile
@seanislegend
seanislegend / gist:12cf3d47e9389cf8059e0741b06ace45
Created February 14, 2017 15:34
Gitlab CI coveragr from Istanbul
Lines\s*:\s*(\d*\.?\d+)%
@seanislegend
seanislegend / options.json
Created January 27, 2016 11:16
iOS Camera default options
{
"DestinationType":{
"DATA_URL":0,
"FILE_URI":1,
"NATIVE_URI":2
},
"EncodingType":{
"JPEG":0,
"PNG":1
},
@seanislegend
seanislegend / rxjs-example-poll-url.js
Last active August 12, 2019 09:43
RxJS - Poll a URL
let timeout = 1000;
/**
* Create a custom observable that creates a XHR request and returns complete when the promise is fulfilled
*/
let observable = Rx.Observable.create((o) => {
dataService.fetch('test.json')
.then((data) => {
o.onNext(data);
o.onCompleted();
@seanislegend
seanislegend / rxjs-example-keyboard-input.js
Created September 15, 2015 14:07
RxJS - Keyboard input
/*
* The element to use, in this case a search field.
*/
let input = document.getElementById('input');
let results = document.getElementById('results');
/**
* Create an Observable that will receive all keyup events
*/
let source = Rx.Observable.fromEvent(input, 'keyup')
@seanislegend
seanislegend / map-reverse.scss
Created November 19, 2014 14:00
Reverse the order of a SASS map.
@function mapReverse ($map) {
$result: null;
@if type-of($map) == "map" {
$keys: map-keys($map);
$map-reversed: ();
@for $i from length($keys) through 1 {
$map-reversed: map-merge(
$map-reversed,
# Outputs the reading time
# "A 4 minute read"
# Put into your _plugins dir in your Jekyll site
# Usage: A {{ page.content | reading_time }} read
module ReadingTimeFilter
def reading_time( input )
words_per_minute = 180
@seanislegend
seanislegend / django-template-list
Created April 16, 2014 09:29
Create a list to use in a for-loop in Django templates.
{% with 'one two three four five six' as list %}
{% for item in list.split %}
{{ item }}<br>
{% endfor %}
{% endwith %}