Skip to content

Instantly share code, notes, and snippets.

View cljoly's full-sized avatar
If I’m not answering within 7 days, please ping me again!

Clément Joly cljoly

If I’m not answering within 7 days, please ping me again!
View GitHub Profile
# Trying to install ojs-base
$ opam install ojs-base
Your request can't be satisfied:
- No package matches ojs-base.
No solution found, exiting
# But it is the right name !
$ opam search ojs-base
# Existing packages for 4.02.1:
ojs-base -- Components to create web applications using js_of_ocaml and websoc
(* ocamlfind ocamlopt -o exmpl -package curl -linkpkg exmpl.ml *)
open Printf
let _ = Curl.global_init Curl.CURLINIT_GLOBALALL
(*
*************************************************************************
** Aux. functions
*************************************************************************
*)
@cljoly
cljoly / to_test.ml
Last active August 29, 2015 14:21
Beginning with Alcotest
(*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
$ sudo npm install -g gulp
/usr/bin/gulp -> /usr/lib/node_modules/gulp/bin/gulp.js
gulp@3.8.11 /usr/lib/node_modules/gulp
├── pretty-hrtime@0.2.2
├── interpret@0.3.10
├── deprecated@0.0.1
├── archy@1.0.0
├── minimist@1.1.1
├── tildify@1.0.0 (user-home@1.1.1)
$ npm install
npm WARN package.json learnmorse@0.0.1 No repository field.
npm WARN optional dep failed, continuing fsevents@0.3.6
> ws@0.5.0 install /home/lwzukw/Documents/code/learnmorse/node_modules/browser-sync/node_modules/socket.io/node_modules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make : on entre dans le répertoire « /home/lwzukw/Documents/code/learnmorse/node_modules/browser-sync/node_modules/socket.io/node_modules/engine.io/node_modules/ws/build »
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
events.js:72
throw er; // Unhandled 'error' event
^
Error: Error: angular-local-storage is not installed. Try running `bower install`.
at /home/lwzukw/Documents/code/forget-me-note/node_modules/wiredep/wiredep.js:30:56
at /home/lwzukw/Documents/code/forget-me-note/node_modules/wiredep/lib/detect-dependencies.js:145:29
at forOwn (/home/lwzukw/Documents/code/forget-me-note/node_modules/wiredep/node_modules/lodash/dist/lodash.js:2106:15)
at Function.forEach (/home/lwzukw/Documents/code/forget-me-note/node_modules/wiredep/node_modules/lodash/dist/lodash.js:3303:9)
at detectDependencies (/home/lwzukw/Documents/code/forget-me-note/node_modules/wiredep/lib/detect-dependencies.js:34:7)
import sys
import markdown
import yaml
import os
from jinja2 import Environment, FileSystemLoader
with open(sys.argv[2], 'r') as f:
content = yaml.safe_load(f.read())
for k in content:
@cljoly
cljoly / cmd.ml
Last active August 29, 2015 14:26
Using common arguments with Command module of the Core library - Solved
(* Build with:
* corebuild cmd.byte *)
open Core.Std;;
(* With this code, we are trying to
* Define a common set of arguments to be passed to all sub commands
* Handle these common arguments all the same way
* Define sub commands in a common, less verbose way *)
let i = Reader.open_file "each.pi";;
let o = Writer.open_file "each.pi.out";;
o >>= (fun o -> i >>= (fun i -> Reader.read_one_chunk_at_a_time i ~handle_chunk:(fun
str ~pos ~len ->
printf "Pos: %i, Len: %i" pos len;
Bigstring.to_string str
|> String.filter ~f:(function '\n' | '\r' | ' ' -> false | _ -> true)
|> Bigstring.of_string
|> Writer.write_bigstring o;