Skip to content

Instantly share code, notes, and snippets.

@andersondias
andersondias / ordering.sql
Last active January 6, 2016 05:56
Ordering by nulls on Postgres
-- Default order will return NULL values at
-- the end of list
SELECT value FROM example ORDER BY value;
------------
-- value --
------------
-- 1 --
-- 2 --
-- 3 --
-- NULL --
@thedouglenz
thedouglenz / wiki.php
Last active August 29, 2015 14:18
Wikipedia information from the command line
#!/usr/bin/env php
<?php
/*
* A program to grab a quick summary of some topic from Wikipedia.
* Usage: wiki <subject>
*
* subject can contain spaces if, for example, it is more than one word.
* Examples
* `wiki cherry bomb`
* `wiki Hercules`
@tnoda
tnoda / page17.clj
Last active August 29, 2015 14:12
The id-mat function in page 17 of the book, "Clojure for Machine Learning" by Akhil Wali, does not work.
(defn id-mat
"Creates an identity matrix of n x n size"
[n]
(let [init (square-mat n 0 :implementation :clatrix)
identity-f (fn [i j n]
(if (= i j) 1 n))]
(cl/map-indexed identity-f init)))
;; clj-ml1.matrix-basics> (id-mat 5)
;; A 5x5 matrix
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@nachocab
nachocab / instructions.sh
Last active February 13, 2022 15:45
How to make git diff work perfectly with .docx files in Mac OS X (it even colors by word)
# download docx2txt by Sandeep Kumar
wget -O docx2txt.pl http://www.cs.indiana.edu/~kinzler/home/binp/docx2txt
# make a wrapper
echo '#!/bin/bash
docx2txt.pl $1 -' > docx2txt
chmod +x docx2txt
# make sure docx2txt.pl and docx2txt are your current PATH. Here's a guide
http://shapeshed.com/using_custom_shell_scripts_on_osx_or_linux/
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
(ns fj
(:import [java.util.concurrent RecursiveTask
ForkJoinPool]))
(set! *warn-on-reflection* true)
;; -----------------------------------------------
;; Helpers to provide an idiomatic interface to FJ
(defprotocol IFJTask