Skip to content

Instantly share code, notes, and snippets.

View fxfactorial's full-sized avatar
🎯
Focusing

@edgararout fxfactorial

🎯
Focusing
View GitHub Profile
@fxfactorial
fxfactorial / alltheflags.md
Created February 26, 2016 03:40 — forked from CodaFi/alltheflags.md
Every Option and Flag /swift (1.2) Accepts Ever

#Every Single Option Under The Sun

  • optimization level options
  • automatic crashing options
  • debug info optionsemit
  • swift internal options
  • swift debug/development internal options
  • linker-specific options
  • mode options
#!/usr/bin/env ocaml
(* Need topfind to make require work, need require to use podge package *)
#use "topfind"
#require "podge"
module U = Yojson.Basic.Util
let local_phones () =
Podge.Unix.read_process_output "gandalf -s"
(* #require "lwt.unix" *)
(* open Lwt.Infix *)
(* let () = *)
(* Lwt_main.at_exit (fun () -> Lwt_io.printl "Ended program"); *)
(* Lwt_main.run (Lwt_io.printl "Hello world" >>= fun () -> Lwt.fail (failwith "OOOPS!")) *)
(* https://www.hackerrank.com/challenges/sequence-full-of-colors *)
@fxfactorial
fxfactorial / gist:56b07f50bacfff86b7a135960abbeeb6
Created April 11, 2016 15:54 — forked from patshaughnessy/gist:70519495343412504686
How to Debug Postgres using LLDB on a Mac
This note explains how to build Postgres from source and setup to debug it using LLDB on a Mac. I used this technique to research this article:
http://patshaughnessy.net/2014/10/13/following-a-select-statement-through-postgres-internals
1. Shut down existing postgres if necessary - you don’t want to mess up your existing DB or work :)
$ ps aux | grep postgres
pat 456 0.0 0.0 2503812 828 ?? Ss Sun10AM 0:11.59 postgres: stats collector process
pat 455 0.0 0.0 2649692 2536 ?? Ss Sun10AM 0:05.00 postgres: autovacuum launcher process
pat 454 0.0 0.0 2640476 304 ?? Ss Sun10AM 0:00.74 postgres: wal writer process
pat 453 0.0 0.0 2640476 336 ?? Ss Sun10AM 0:00.76 postgres: writer process
@fxfactorial
fxfactorial / interp.lhs
Created May 5, 2016 18:33 — forked from antonycourtney/interp.lhs
My own notes and exercises written while reading Wadler's wonderful "Monads for Functional Programming" in 1998
A really simple interpreter to use while learning about monads. Based on
the paper "Monads for Functional Programming" by Phil Wadler.
the type of terms:
> data Term = Con Int
> | Div Term Term
> deriving Show

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

root@plex:~# uname -a
Linux plex 3.13.0 BrandZ virtual linux x86_64 x86_64 x86_64 GNU/Linux
root@plex:~# /native/usr/bin/uname -a
SunOS plex 5.11 joyent_20160524T122512Z i86pc i386 i86pc
root@plex:~# cat /etc/issue
Ubuntu 14.04.4 LTS \n \l
root@plex:~# /native/usr/sbin/dtrace -n 'lx-syscall:::entry {@[probefunc] = count()}' -c "ls"
dtrace: description 'lx-syscall:::entry ' matched 676 probes
HDHRViewerV2-beta-0.05.zip Music plex.deb src test upgrade-plex
@fxfactorial
fxfactorial / package.ml
Created June 11, 2016 17:53 — forked from hannesm/package.ml
Find reverse dependencies, output into a dot file
#!/usr/bin/env ocaml
#use "topfind"
#require "findlib"
#require "astring"
let requires name =
try
let reqs = Findlib.package_property ["native"] name "requires" in
Astring.String.cuts ~empty:false ~sep:" " reqs
with Not_found -> []
@fxfactorial
fxfactorial / future_plans.ml
Created July 22, 2016 09:03
Ideas that I want to work towards
let javascript_from_ocaml
(* Let me do (object%js val count = 10 end) and count becomes a top
level var count = 10; *)
?(js_global_values: 'a Js.t option)
(* of course we want to use js_of_ocaml.ppx by default *)
?(ocaml_pkgs=["js_of_ocaml.ppx"])
(* self-explanatory *)
?(minified=true)
(* Only include JavaScript, no linking of the Dom API at all, only
what's limited to the JavaScript language *)

##To Install libwkhtmltox

  • Clone the wkhtmltopdf repo git clone --recursive https://github.com/wkhtmltopdf/wkhtmltopdf.git
  • You need the fpm gem to install sudo gem install fpm --no-ri --no-rdoc - it will be installed in /usr/bin so make sure that's in your path.
  • Checkout the latest release tag IE git checkout tags/0.12.2.
  • In the directory and run scripts/build.py osx-cocoa-x86-64(this will take a while! You're building Qt)
  • If you get an error like: error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: bin/libwkhtmltox.0.12.2.2.dylib (No such file or directory) all you need to do is match the version in the VERSION file in the base directory to the number between libwkhtmltox. and .dylib of the compiled file in static-build/osx-cocoa-x86-64/app/bin
  • If you're not on OS X, refer to INSTALL.md in the wkhtmltopdf repo for build instructions.