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
// this is the "generated" code (loading from fs is still 'generating'...) | |
module.exports = function() { console.log('hello world'); } |
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
-- | Garden variety prime sieve | |
isPrime x = not $ any divisible $ takeWhile bounded [2..] where | |
divisible y = x `mod` y == 0 | |
bounded y = y * y <= x | |
-- | Germain prime sieve | |
isGermainPrime x = (isPrime x) && (isPrime (2*x + 1)) | |
-- | All of the Germain primes |
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
var noflo = require('noflo'); | |
var fbp = require('fbp'); | |
var fs = require('fs'); | |
var path = require('path'); | |
var util = require('util'); | |
var browserify = require('browserify'); | |
var coffeeify = require('coffeeify'); | |
var through = require('through2'); | |
var stream = require('stream'); | |
var wait = require('wait.for'); |
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
noflo = require 'noflo' | |
browserify = require 'browserify' | |
evil = require 'notevil' | |
class Bundler extends noflo.Component | |
icon: 'gift' | |
description: 'Bundles input files using Browserify' | |
constructor: -> | |
@inPorts = new noflo.InPorts | |
bundle: |
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
data TicketId' a = TicketId a deriving (Functor) | |
type TicketId = TicketId' Int | |
type TicketIdColumn = TicketId' (Column PGInt4) | |
$(makeAdaptorAndInstance "pTicketId" ''TicketId') | |
data Ticket' a b c d e = Ticket { _tId :: a | |
, _tTicket :: b | |
, _tUserId :: c | |
, _tExpires :: d | |
, _tConsumed :: e } |
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 Arrows #-} | |
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeSynonymInstances #-} | |
module Haven.Types where |
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 Arrows #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeSynonymInstances #-} | |
{-# LANGUAGE StandaloneDeriving #-} |
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 Arrows #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeSynonymInstances #-} | |
{-# LANGUAGE StandaloneDeriving #-} |
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
#!/bin/bash | |
function atoi { | |
IP=$1; IPNUM=0 | |
for (( i=0 ; i<4 ; ++i )); do | |
((IPNUM+=${IP%%.*}*$((256**$((3-${i})))))) | |
IP=${IP#*.} | |
done | |
echo $IPNUM | |
} |
OlderNewer