Skip to content

Instantly share code, notes, and snippets.

View xandkar's full-sized avatar
🤔
quis custodiet ipsos custodes?

Siraaj Khandkar xandkar

🤔
quis custodiet ipsos custodes?
View GitHub Profile
@xandkar
xandkar / Makefile
Last active February 25, 2016 07:38
X-Plane Autopilot POC
build:
@ocamlbuild \
-use-ocamlfind \
-tags thread \
-syntax camlp4o \
-pkgs bitstring.syntax,bitstring,core,async \
x_plane_autopilot.byte
deps:
@opam install core async bitstring
k[{s_}] := s;
k[ss_] := k[RotateLeft[ss][[2 ;; -1]]];
j[n_] := k[Range[1, n]]
@xandkar
xandkar / springer-free-maths-books.md
Created December 29, 2015 13:18 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
@xandkar
xandkar / det.nb
Last active December 3, 2015 23:41
Matrix determinant terms in Mathematica
detTerms[m_] := Module[
{n, indices, is, js, termsIndices, termsWithRowI},
{n, n} = Dimensions[m];
indices = Range[1, n];
is = Permutations[indices];
js = Table[indices, n!];
termsIndices =
MapThread[MapThread[{#1, #2} &, {#1, #2}] &, {is, js}];
termsWithRowI =
Map[Map[{#[[1]], m[[#[[1]], #[[2]]]]} &, #] &, termsIndices];
Function[{m, a, b}, Map[ToExpression @* Function[row, StringReplace[row, a .. -> b]] @* ToString, m]]
#! /bin/bash
set -e
slackbot_responses_add() {
declare -r team=$1
declare -r token="token=$2"
declare -r triggers="triggers=$3"
declare -r responses="responses=$4"
declare -r data="$triggers&$responses&$token&set_active=true&_attempts=1"
Code Reason phrase
100 Continue
101 Switching Protocols
102 Processing
200 OK
201 Created
202 Accepted
203 Non-Authoritative Information
204 No Content
205 Reset Content
@xandkar
xandkar / list_ref.erl
Last active September 20, 2015 14:42
Playing with alternatives for accumulating-then-flattening-nested-lists
-module(list_ref).
-export(
[ create/0
, append/2
, take/1
]).
create() ->
make_ref().
(* -*- caml -*- *)
(* @@PLEAC@@_NAME *)
(* @@SKIP@@ Objective CAML @@SKIP@@ *)
(* @@PLEAC@@_WEB *)
(* @@SKIP@@ http://www.ocaml.org/ @@SKIP@@ *)
(* @@PLEAC@@_APPENDIX *)
open Printf
module Datum = struct
type t =
{ index : int
; v1 : float
; v2 : float
; v3 : float
; v4 : float
; v5 : float
; v6 : float
; v7 : float