Skip to content
{{ message }}

Instantly share code, notes, and snippets.

# Wes Cravens wcravens

Last active Jul 18, 2019
module test
View module_pattern.spec.js
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
 /* jshint expr:true */ /* globals describe, it, beforeEach */ var chai = require( 'chai' ) , expect = chai.expect ; var moduleNames = ['lib/recurringDateObjects']; var moduleMethods = [];
Last active Mar 24, 2021 — forked from mikehaertl/gist:3258427
Learn you a Haskell - In a nutshell
View gist:0e1e423ce1823b718b9d5b1ddf6acffa

## Learn you a Haskell - In a nutshell

This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.

# 1. Introduction

• Haskell is a functional programming language.
Created Sep 29, 2016
Leibniz pi calculation; Learn You a Haskell Exercices
View gist:23f8ec6dc8b1bcf6447521314d7300e2
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
 stepReverseSign :: (Fractional a, Ord a) => a -> a -> a stepReverseSign num step = (if num > 0 then -1 else 1) * (abs(num) + step) piCalc :: (Fractional a, Integral b, Ord a) => a -> (a, b) piCalc tolerance = piCalc' 1 0.0 tolerance 0 piCalc' :: (Ord a, Fractional a, Integral b) => a -> a -> a -> b -> (a, b) piCalc' denominator pi tolerance iterations = | abs( pi' - pi) < tolerance = ( pi', iterations ) | otherwise = piCalc' (stepReverseSign denominator) pi' tolerance (iterations + 1)
Created Dec 23, 2013
pg_prove not picking up files in test/
View gist:8096594
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
 wcravens@aberforth:~/Repos/hoas/database\$ pg_prove --version pg_prove 3.29 wcravens@aberforth:~/Repos/hoas/database\$ ls test/* test/address.sql wcravens@aberforth:~/Repos/hoas/database\$ pg_prove -d hoas_test test/*.sql test/address.sql .. ok All tests successful. Files=1, Tests=1, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.03 cusr 0.00 csys = 0.07 CPU) Result: PASS wcravens@aberforth:~/Repos/hoas/database\$ pg_prove -d hoas_test test/
Created Jan 28, 2013
View gist:4655739
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 MyRole; use Moo; with 'Foo'; 1; package main; use Test::More; ok my \$foo = MyRole->new( bar => baz );
Created Feb 25, 2012 — forked from diegok/gist:1905030
View gist:1908098
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
 sub set_config { my \$self = shift; my \$config = My::Config->new; \$self->app->log->debug( \$config->test ); #yay \$self->helper( config => sub { \$config } ); \$self->log->debug( \$self->config->test ); # Can't call method "test" on unblessed reference }
Created Dec 15, 2011
View gist:1480965
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
 #!/usr/bin/env perl use Mojolicious::Lite; get '/' => sub { shift->render('test/tab/index') }; app->start;