Emacs Configuration File
(defun tangle-init ()
"If the current buffer is 'init.org' the code-blocks are
tangled, and the tangled file is compiled."
(when (equal (buffer-file-name)
VALUE | |
rb_ary_sort_bang(VALUE ary) | |
{ | |
rb_ary_modify(ary); | |
assert(!ARY_SHARED_P(ary)); | |
if (RARRAY_LEN(ary) > 1) { | |
VALUE tmp = ary_make_substitution(ary); /* only ary refers tmp */ | |
struct ary_sort_data data; | |
long len = RARRAY_LEN(ary); |
a = [ "d", "a", "e", "c", "b" ] | |
a.sort! #=> ["a", "b", "c", "d", "e"] | |
a.sort! { |x,y| y <=> x } #=> ["e", "d", "c", "b", "a"] |
// Collect the complete content of three URLs and print it to the console. | |
// Print one line per URL. | |
// Print out them out in the same order as the URLs are provided to you as command-line arguments. | |
var http = require('http'); | |
var urls = []; | |
for (var i = 2; i < process.argv.length; i++) { | |
urls.push(process.argv[i]); | |
} |
var http = require('http') | |
var bl = require('bl') | |
var results = [] | |
var count = 0 | |
function printResults () { | |
for (var i = 0; i < 3; i++) | |
console.log(results[i]) | |
} | |
(defun tangle-init ()
"If the current buffer is 'init.org' the code-blocks are
tangled, and the tangled file is compiled."
(when (equal (buffer-file-name)
(defun tangle-init () | |
"If the current buffer is 'init.org' the code-blocks are | |
tangled, and the tangled file is compiled." | |
(when (equal (buffer-file-name) | |
(expand-file-name (concat user-emacs-directory "init.org"))) | |
;; Avoid running hooks when tangling. | |
(let ((prog-mode-hook nil)) | |
(org-babel-tangle) | |
(byte-compile-file (concat user-emacs-directory "init.el"))))) |
/* | |
Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod | |
May contain errors where latitude and longitude are off. Use at own non-validated risk. | |
*/ | |
SET NAMES utf8; | |
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; | |
DROP TABLE IF EXISTS postcodes_geo; |
# Sample implementation of quicksort and mergesort in ruby | |
# Both algorithm sort in O(n * lg(n)) time | |
# Quicksort works inplace, where mergesort works in a new array | |
def quicksort(array, from=0, to=nil) | |
if to == nil | |
# Sort the whole array, by default | |
to = array.count - 1 | |
end |
(defun tangle-init ()
"If the current buffer is 'init.org' the code-blocks are
(defun tangle-init ()
"If the current buffer is 'init.org' the code-blocks are