Skip to content

Instantly share code, notes, and snippets.

let keyMutate f = List.map @@ function (a, b, c) -> (f a, b, c)
let legalResult = keyMutate String.uppercase [ ("one", "two", "three"); ("four","five","six") ]
let a = match legalResult with [(a,_,_);(_,_,_)] -> a | _ -> "Something went wrong"
let () = print_endline a
Ld build/Debug/Jumpcore.app/Contents/MacOS/Jumpcore normal x86_64
cd /Users/mcc/work/j/jce/desktop
setenv MACOSX_DEPLOYMENT_TARGET 10.6
/Developer/usr/bin/g++-4.2 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -L/Users/mcc/work/j/jce/desktop/build/Debug -L/Users/mcc/work/j/jce/desktop/static_lib -L/Users/mcc/work/j/jce/desktop/freetype_lib -L/Users/mcc/work/j/jce/desktop/static_lib -L/Users/mcc/work/j/jce/desktop/freetype_lib -L/Users/mcc/work/j/jce/desktop/static_lib -L/Users/mcc/work/j/jce/desktop/freetype_lib -L/Users/mcc/work/j/jce/desktop/freetype_lib -L/Users/mcc/work/j/jce/desktop/../iphone/Classes/ftgles -L/Users/mcc/work/j/jce/desktop/plaid/portaudio -L/Users/mcc/work/j/jce/desktop/freetype_lib -L/Users/mcc/work/j/jce/desktop/../../../h/test-ctypes/install/lib -L/Users/mcc/work/j/jce/desktop/../emily/install/lib -F/Users/mcc/work/j/jce/desktop/build/Debug -F/Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks -F/Users/mcc/work/j/jce/desktop -F. -F/Users/mcc/work/j/jce/desktop -F/Users/mcc/work/j/
andis-macbook:emily mcc$ make BUILD_VERBOSE=1
ocamlbuild -no-links -use-ocamlfind -classic-display -lflag -verbose src/main.native.o src/cApi.o src/cStart.o src/cHelper.o
File "src/_tags", line 3, characters 18-27:
Warning: the tag "use_cpart" is not used in any flag or dependency declaration, so it will have no effect; it may be a typo. Otherwise you can use `mark_tag_used` in your myocamlbuild.ml to disable this warning.
ocamlfind ocamldep -package 'ctypes, ctypes.foreign' -modules src/main.ml > src/main.ml.depends
ocamlfind ocamlc -c -safe-string -package 'ctypes, ctypes.foreign' -I src -o src/main.cmo src/main.ml
ocamlfind ocamlopt -c -safe-string -package 'ctypes, ctypes.foreign' -I src -o src/main.cmx src/main.ml
ocamlfind ocamlopt -verbose -linkpkg -linkpkg -output-obj -package 'ctypes, ctypes.foreign' src/main.cmx -o src/main.native.o
+ ocamlfind ocamlopt -verbose -linkpkg -linkpkg -output-obj -package 'ctypes, ctypes.foreign' src/main.cmx -o src/main.native.o
Effective set of compiler predicates: pkg
#!/usr/bin/python
# This is a variant of regression.py that repeats regression.py tests across revisions.
# Usage: ./develop/performance/perfRegression.py -a
# Tested with Python 2.6.1
import sys
import os
import subprocess
import optparse
#!/usr/bin/python
# NOTE: BEFORE EXECUTING, REPLACE THE PATH IN cwd= IN THE FINAL LINE.
import subprocess
import copy
import os
globalEnv = copy.deepcopy( os.environ )
globalEnv["HGPLAIN"]="1" # Disable pager, etc in any following calls
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-5.5 (5.5.44-0ubuntu0.14.04.1) ...
start: Job failed to start
@mcclure
mcclure / gist:b7f44448b854d9c78c0b
Last active December 14, 2015 02:06
I am thinking about recursive make

So normally the way you run make is you just run

make

It searches for a file Makefile in the current directory and runs it. Yay! Sometimes, you want to make something in a subdirectory. You could type

cd subproject && make

But that's annoying, so make lets you do

# THIS WORKS
mkdir -p a && mkdir -p b && (cd a && npm install jquery) && echo "module.exports = { context:\""`pwd`"/a\" }" > b/webpack.config.js && echo "require(\"jquery\")" > b/source.js && (cd b && webpack source.js bundle.js)
# WHAT IT PRINTS:
# [email protected] ../node_modules/jquery
# Hash: 68508185a6c9c12015ac
# Version: webpack 1.12.9
# Time: 943ms
# Asset Size Chunks Chunk Names
ROUTE
ESCAPE, UPPATH (tree pull, lumber check), LOSTWOODS, KAKARIKO, RACE (library check), AQUADUCT, HYPECAVE, ICECAVE (left), FAKESWIM, HOBO
[money]+[mitt]?
CATFISH IF POSSIBLE [mitt]
WITCH [mushroom], ZORA [money, mitt], ZORA [flippers]
[bow] or low?
SASH 3, EASTERN 3 [5 open, 1 bow]
using System;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
// NOTE A: Change the "struct" to a "class" on line NOTE A below and crash disappears
// NOTE B: Change the "float[] data" to "float data;" on line NOTE B below and crash disappears
// NOTE C: Change SamCombatant() to PlayerCombatant() on line NOTE C below and crash disappears
class Test {
[Serializable()]