Skip to content

Instantly share code, notes, and snippets.

@aslansky
aslansky / gist:8741515
Created January 31, 2014 19:44
gulp livereload (gulp 3.5.0)
var gulp = require('gulp');
var gutil = require('gulp-util');
var sass = require('gulp-sass');
var lr = require('tiny-lr');
var http = require('http');
var path = require('path');
var ecstatic = require('ecstatic');
var tlr = lr();
var livereload = function (evt, filepath) {
tlr.changed({
@ethul
ethul / angular-ui--bootstrap-position--jqm.js
Created February 4, 2014 18:12
Snapshot of the ui.bootstrap.position module from 2013-11-30
angular.module('ui.bootstrap.position', [])
/**
* A set of utility methods that can be use to retrieve position of DOM elements.
* It is meant to be used where we need to absolute-position DOM elements in
* relation to other, existing elements (this is the case for tooltips, popovers,
* typeahead suggestions etc.).
*/
.factory('$position', ['$document', '$window', function ($document, $window) {
@tonymorris
tonymorris / scaladoc.md
Created February 8, 2014 00:35
This is one reason why scaladoc is not documentation. You know, reliability and all that important stuff.
@mattpodwysocki
mattpodwysocki / buffering.js
Created February 14, 2014 21:54
Backpressure mechanisms in RxJS
var source = Rx.Observable.interval(100).bufferWithTimeOrCount(500 /*ms*/, 50 /* items */);
source.subscribe(function (arr) {
// Have chunked array based upon time or count, whichever hits first
})
private void LoadSpotTiles()
{
_referenceDataRepository.GetCurrencyPairsStream()
.ObserveOn(_concurrencyService.Dispatcher)
.SubscribeOn(_concurrencyService.TaskPool)
.Subscribe(
currencyPairs => currencyPairs.ForEach(HandleCurrencyPairUpdate),
error => _log.Error("Failed to get currencies", error));
}
TITLE: GCN CIRCULAR
NUMBER: 16332
SUBJECT: Swift detection of a bright X-ray source in M31
DATE: 14/05/27 22:15:08 GMT
FROM: Scott Barthelmy at NASA/GSFC <scott@milkyway.gsfc.nasa.gov>
S. D. Barthelmy (GSFC), W. H. Baumgartner (GSFC/UMBC),
S. B. Cenko (GSFC), V. D'Elia (ASDC), D. Malesani (DARK/NBI),
V. Mangano (PSU), F. E. Marshall (NASA/GSFC) and
B. Sbarufatti (INAF-OAB/PSU) report on behalf of the Swift Team:
@cartazio
cartazio / Functor.swift
Created June 2, 2014 23:48
my attempt at a functor protocol in Swift lang
protocol Functor {
typealias ElemTyIn
typealias ContainerTyIn
typealias ElemTyOut
typealias ContainerTyOut
func fmap(ElemTyIn->ElemTyOut,ContainerTyIn)->ContainerTyOut
}
@rampion
rampion / Unique.hs
Last active August 29, 2015 14:02
Indexed Monad for uniquely consumed values
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE DeriveFunctor #-}
module Unique (
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Main (insert, delete, lookup, runTrackedMap, main) where
import Prelude hiding (lookup)
import Control.Applicative (Applicative)
import Data.Set (Set)
#!/bin/sh
cd /tmp/
git clone --recursive https://github.com/rust-lang/cargo
cd cargo
make
make install
cd $HOME
rm -rf /tmp/cargo