Skip to content

Instantly share code, notes, and snippets.

View markandrus's full-sized avatar
🍊
orange

Mark Roberts markandrus

🍊
orange
View GitHub Profile
var m = require('continuable-fantasy'),
ma = m.of('Hello world'),
me = m.error(new Error('Some error'));
/*fs = require('fs'),
ma = m(fs.readFile.bind(null, __filename)).map(function(a) {
return a.toString();
});*/
function check(l, r) {
var succs = [], errs = [], n = 2;
@markandrus
markandrus / Jekyll and Octopress Liquid tag for MathJax.rb
Last active December 17, 2015 05:39 — forked from jessykate/Jekyll nd Octopress Liquid tag for MathJax.rb
This edit improves compatibility with Markdown processors that output XHTML.
module Jekyll
class MathJaxBlockTag < Liquid::Tag
def render(context)
"<script type=\"math/tex; mode=display\">\n%<![CDATA["
end
end
class MathJaxInlineTag < Liquid::Tag
def render(context)
"<script type=\"math/tex\">\n%<![CDATA["
end
@markandrus
markandrus / samsung-arm-chromebook.md
Last active December 17, 2015 00:10
Making the most of your Samsung ARM Chromebook

Making the most of your Samsung ARM Chromebook

Here are five steps you can take to setup a comfortable development environment on your Chromebook. These tips can be found in numerous places online.

So far, using the Samsung ARM Chromebook has been pretty flippin' sweet. I'm just waiting for ARM support for ghci!

  1. Enable Developer Mode

@markandrus
markandrus / results.txt
Created April 12, 2013 17:12
All graduate and undergraduate courses at the University of Chicago from 2005 to 2013 (as listed on classes.uchicago.edu).
This file has been truncated, but you can view the full file.
{:prefix=>"AKKD", :code=>"10103/01", :title=>"Elementary Akkadian-3"}
{:prefix=>"AKKD", :code=>"20357/01", :title=>"Old Assyrian Texts"}
{:prefix=>"AKKD", :code=>"30326/01", :title=>"Akkadian Medical Texts"}
{:prefix=>"AKKD", :code=>"49900/00", :title=>"Advanced Rdgs: Akkadian-1"}
{:prefix=>"AKKD", :code=>"10102/01", :title=>"Elementary Akkadian-2"}
{:prefix=>"AKKD", :code=>"20313/01", :title=>"Akkadian Historical Texts-1"}
{:prefix=>"AKKD", :code=>"30353/01", :title=>"Late Babylonian Letters"}
{:prefix=>"AKKD", :code=>"40399/01", :title=>"Eblaite"}
{:prefix=>"AKKD", :code=>"10101/01", :title=>"Elementary Akkadian-1"}
{:prefix=>"AKKD", :code=>"20307/01", :title=>"Akkadian Literary Texts-1"}
@markandrus
markandrus / User.js
Last active May 3, 2016 16:38
Minimal User model for a Node.js project using JugglingDB, bcrypt, and Postgres. See something wrong with my salting and password hashing? Please let me know!
var Schema = require('jugglingdb').Schema,
bcrypt = require('bcrypt');
var schema = new Schema('postgres', { /* ... */ });
var User = schema.define('User', {
email: { type: String, length: 255 },
password: { type: String, length: 255 },
salt: { type: String, length: 255, default: bcrypt.genSaltSync(10) },
created: { type: Date, default: Date.now }
@markandrus
markandrus / drupal-scrape-1.sh
Last active December 13, 2015 19:48
First bit of a script to scrape a particular Drupal site I'm working with.
#!/bin/sh
<<README
Requires:
* curl 7.24
* tidy 15.10
* xpath 5.12
README
{- Datatype -}
-- | Stores a word, its number of occurrences, and its phonemes.
data DX1Entry = DX1Entry
{ _name :: String
, _count :: Int
, _phonemes :: [String] }
deriving (Eq)
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
typedef struct entry {
struct entry *next;
void *data;
} entry_t;
entry_t *
=begin
First iteration of an arithmetic expression parser.
TODO: Implement precedence.
=end
def parse(str)
n = nil # Integer accumulator.
depth = 0 # Nest expression depth.
require 'thread'
class BinaryTree
def initialize(root)
@root = root
@lock = Mutex.new
end
def dfs(&block)