Skip to content

Instantly share code, notes, and snippets.

// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@aaronlifton3
aaronlifton3 / index.html
Last active August 29, 2015 14:10 — forked from x1ddos/index.html
<html ng-app="ng-demo-app">
<head>
<title>AngularJS simple app demo</title>
</head>
<body ng-controller="MainCtrl">
<input type="text" ng-model="name" ng-required>
<div>{{name}}</div>
<div ng-controller="ChildCtrl">
<input type="text" ng-model="salut">
<div>{{salutation}}</div>
(* Inspired and modified based on http://drosophiliac.com/2012/09/an-academic-notetaking-workflow.html and https://gist.github.com/smargh/6068104 *)
(* PROPERTIES *)
property LF : (ASCII character 10)
property tid : AppleScript's text item delimiters
(* THE SCRIPT *)
tell application "Skim"
set the clipboard to ""
activate
package speculation
import java.util.concurrent.{ Callable, ExecutorService, Future }
class Speculation(val executor: ExecutorService, val mayInterruptIfRunning: Boolean) {
def spec[A,B](guess: => A)(f: A => B)(actual: => A): B = {
val g = executor.submit(new Callable[A] {
def call = guess
})
val speculation = executor.submit(new Callable[B] {
@aaronlifton3
aaronlifton3 / Remote.hs
Last active August 29, 2015 14:07 — forked from ekmett/Remote.hs
{-# LANGUAGE GADTs, Rank2Types, KindSignatures, ScopedTypeVariables, TypeOperators, DataKinds, PolyKinds, MultiParamTypeClasses, FlexibleInstances, TypeFamilies, DoRec, ExtendedDefaultRules #-}
import Control.Applicative
import Control.Category
import Control.Comonad
import Control.Monad.Fix
import Control.Monad (ap)
import Data.Functor.Identity
import Data.Typeable
import Data.Monoid
import Data.Unique
@aaronlifton3
aaronlifton3 / Iso.hs
Last active August 29, 2015 14:07 — forked from ekmett/Iso.hs
{-# LANGUAGE GADTs #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
import Control.Applicative
import Control.Arrow
import Control.Category
@aaronlifton3
aaronlifton3 / Tarjan.hs
Last active August 29, 2015 14:07 — forked from ekmett/Tarjan.hs
{-# LANGUAGE RankNTypes, GADTs, PolyKinds #-}
module Tarjan where
import Control.Applicative
import Control.Category
import Data.Monoid
import Prelude hiding ((.),id)
-- Radu Mihaesau and Robert Tarjan's Catenable Deque

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors

;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.

As compiled by Kevin Wright a.k.a @thecoda

(executive producer of the movie, and I didn't even know it... clever huh?)

please, please, please - If you know of any slides/code/whatever not on here, then ping me on twitter or comment this Gist!

This gist will be updated as and when I find new information. So it's probably best not to fork it, or you'll miss the updates!

Monday June 16th