Hi:
perl -e 'print "hello world!\n"'
A simple filter:
perl -ne 'print if /REGEX/'
Filter out blank lines (in place):
| //------------------------------------------------------------- | |
| // | |
| // Hypothesis: | |
| // | |
| // Promises/A is a Monad | |
| // | |
| // To be a Monad, it must provide at least: | |
| // - A unit (aka return or mreturn) operation that creates a corresponding | |
| // monadic value from a non-monadic value. | |
| // - A bind operation that applies a function to a monadic value |
| /* | |
| * Grammar to generate an S-Expressions parser for Javascript using http://pegjs.majda.cz/ | |
| */ | |
| start | |
| = expression* | |
| integer "integer" | |
| = digits:[0-9]+ { return parseInt(digits.join(""), 10); } |
Hi:
perl -e 'print "hello world!\n"'
A simple filter:
perl -ne 'print if /REGEX/'
Filter out blank lines (in place):
| { | |
| "vars": { | |
| "@gray-darker": "lighten(#000, 13.5%)", | |
| "@gray-dark": "lighten(#000, 20%)", | |
| "@gray": "lighten(#000, 33.5%)", | |
| "@gray-light": "lighten(#000, 46.7%)", | |
| "@gray-lighter": "lighten(#000, 93.5%)", | |
| "@brand-primary": "#c70850", | |
| "@brand-success": "#5cb85c", | |
| "@brand-info": "#5bc0de", |
At DICOM Grid, we recently made the decision to use Haskell for some of our newer projects, mostly small, independent web services. This isn't the first time I've had the opportunity to use Haskell at work - I had previously used Haskell to write tools to automate some processes like generation of documentation for TypeScript code - but this is the first time we will be deploying Haskell code into production.
Over the past few months, I have been working on two Haskell services:
I will write here mostly about the first project, since it is a self-contained project which provides a good example of the power of Haskell. Moreover, the proces
| #!/usr/bin/env bash | |
| for voice in $(say -v ? | perl -pe 's/^(.*?)\s.*$/$1/'); do quote=$(curl -s http://www.iheartquotes.com/api/v1/random?source=starwars | perl -pe 's/\[starwars.*?$//g'); echo $voice; say -v $voice $quote; done |
| /******************************************************************************* | |
| WHAT: Read SMC keys that Apple's powermetrics tool uses. Requires OS X 10.10 | |
| RUN: sudo dtrace -qCs powermetrics.d -c 'powermetrics --sampler smc -n 1' | |
| DETAIL: This lets us see what hardware components/functions they map to. | |
| LICENSE: MIT | |
| AUTHOR: beltex <http://beltex.github.io> | |
| REFERENCES: | |
| - Advanced Mac OS X Programming: The Big Nerd Ranch Guide |
This has been moved to a blog post.
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: | |
| The above copyright notice and this permission notice shall be included in all | |
| copies or substantial portions of the Software. |