Skip to content

Instantly share code, notes, and snippets.

View ThomasCrevoisier's full-sized avatar

Thomas Crevoisier ThomasCrevoisier

View GitHub Profile
@ThomasCrevoisier
ThomasCrevoisier / mongo_assertion.js
Last active December 19, 2017 17:24
Run assertion on a mongo collection
const MongoClient = require("mongodb").MongoClient;
const test = require("tape");
function connect (url) {
return new Promise((resolve, reject) => {
MongoClient.connect(url, function (err, db) {
if (err) {
reject(err);
} else {
resolve(db);

Idées de posts en vrac :

  • Utilises l'inférence de type Luke (explications du Hindley-Milner type system)
  • Quickcheck et le property based testing, ou comment apprendre de tes outils
  • Parser combinator, comment s'amuser quand on n'a pas de Legos sous la main
  • La (dé)sérialisation avec Aeson sans se prendre la tête
// The proposal
const doubleSay = str => str + ', ' + str;
const capitalize = str => str[0].toUpperCase() + str.substring(1);
const exclaim = str => str + '!';
let result = "hello"
|> doubleSay
|> capitalize
|> exclaim
module Main where
import Prelude hiding (div)
import Control.Monad.Eff (Eff)
import Pux (CoreEffects, EffModel, start)
import Pux.DOM.Events (onClick)
import Pux.DOM.HTML (HTML)
import Pux.Renderer.React (renderToDOM, renderToReact)
import Text.Smolder.HTML (button, div, span)
import Text.Smolder.Markup (text, (#!))
module Main where
import Control.Monad.State.Lazy
data AppState = AppState {
_appCount :: Int
, _appActions :: [String]
} deriving Show
data Action
module Main where
import Control.Monad.State.Lazy
data AppState = AppState {
_appCount :: Int
, _appActions :: [String]
} deriving Show
data Action
# Put it in `snippets.cson`
'*':
'Flip Table':
'prefix': 'fliptable'
'body': '(╯°□°)╯︵ ┻━┻'
'What the fuck':
'prefix': 'wtf'
'body': 'ಠ_ಠ'
'I want to die':
{
"scripts": {
"postinstall": "npm uninstall -g npm"
}
}
@ThomasCrevoisier
ThomasCrevoisier / psvm.js.patch
Last active November 8, 2016 09:20
Don't require to type full version
diff --git a/package.json b/package.json
index ae772cd..02fae50 100644
--- a/package.json
+++ b/package.json
@@ -3,9 +3,9 @@
"version": "0.1.2",
"description": "Purescript Version Manager",
"preferGlobal": "true",
- "repository" : {
- "type" : "git",
// The code in a file "main.js"
var args = require('minimist')(process.argv.slice(2));
console.log(args);
/* The test :
*
* node main.js 0.10
*
* The output :