This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sharing code between node and browser | |
===================================== | |
This is incredibly messy. | |
Using require.js + r.js + amdefine | |
---------------------------------- | |
* Cannot use cs.js for "cs!module" coffee imports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package staticpipeline; | |
class Image implements ProvidesOriginalImage { | |
@Override | |
public Image getOriginalImage() { | |
return null; | |
} | |
} | |
class FaceLocation implements ProvidesFaceLocation { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE NoMonomorphismRestriction #-} | |
module StaticPipeline where | |
data Image = Image | |
data OriginalImage = OriginalImage Image | |
data ProcessedImage = ProcessedImage Image | |
data FaceLocation = FaceLocation | |
data EyeLocation = EyeLocation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DeriveDataTypeable #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
module Main where | |
import Test.Hspec | |
import qualified Test.Hspec.Core as Core | |
import qualified Test.Hspec.Internal as Internal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Vector ((!)) | |
import qualified Data.Vector as V | |
import Data.Vector.Generic.Mutable (write) | |
step ws state = case updatable of [] -> state | |
(i,_):_ -> V.modify (\v -> write v i (o i)) state | |
where | |
n = V.length state | |
w i j = ws ! i ! j |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* COMPILATION NOTE | |
* This has to be compiled with `gcc -z execstack` to allow jumping | |
* into the stack (which is where the JIT generated code is stored | |
* in `jit_area`). | |
*/ | |
// TODO "i" is a bad variable name | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module PktHdrStorableInstance where | |
import Foreign.Marshal.Utils (with) | |
import Foreign.Ptr (plusPtr) | |
import Foreign.Storable | |
import Network.Pcap | |
import Network.Pcap.Base (toPktHdr) | |
#include <pcap.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qualified Data.Vector as V | |
import qualified Data.Vector.Storable as VS | |
import qualified Data.Vector.Unboxed as U | |
main = do | |
_k <- VS.convert (undefined :: U.Vector) :: VS.Vector | |
return () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Updates a variable when the window scrollTop position is changed. | |
# Usage: | |
# <set-window-scroll set-variable="windowScroll"></set-window-scroll> | |
app.directive "setWindowScroll", -> | |
restrict: "E" | |
scope: | |
setVariable: "=" | |
link: (scope) -> | |
$(window).scroll -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# OPTIONS_GHC -fwarn-incomplete-patterns #-} | |
-- | past: Compile-time checked backwards compatibility | |
-- Dealing with data types from the past, forever. | |
-- | |
module Main where | |
OlderNewer