Skip to content

Instantly share code, notes, and snippets.

View davidmason's full-sized avatar

David Mason davidmason

View GitHub Profile
@davidmason
davidmason / sync.sh
Last active December 21, 2015 02:59 — forked from franklinjavier/sync.sh
#!/bin/sh
#
# Set-up Sublime settings + packages sync over Dropbox
#
# Will sync settings + Installed plug-ins
#
# Tested on OSX - should support Linux too as long as
# you set-up correct SOURCE folder
#
# Copyright 2012 Mikko Ohtamaa http://opensourcehacker.com
@davidmason
davidmason / _.md
Created September 12, 2013 01:48
Higher-order fun
@davidmason
davidmason / gist:6927041
Created October 10, 2013 23:08
Simple BASH script that prints a definition of OOP.
wget http://en.wikipedia.org/wiki/Caml ; wget http://en.wikipedia.org/wiki/OCaml ; diff Caml OCaml
@davidmason
davidmason / prep.md
Last active August 29, 2015 14:01
Preparation for campjs talk "Packaging CommonJS for the browser: Webpack and Browserify"

If you just want to watch the talk, you don't need anything. If you want to follow along or play around with webpack and/or browserify at the camp, I recommend preinstalling the following before setting out.

Preinstallation

Just in case the npm mirror is not available at the camp, you can preinstall the following if you want to play around with browserify and webpack:

install nodejs

nodejs is the runtime on which webpack and browserify run (just in case youmanaged not to hear about it somehow)

@davidmason
davidmason / node-on-rhel6.md
Last active August 29, 2015 14:01
Simple node setup on RHEL6

node setup on RHEL6

These are the steps I used today to get node installed and working on my Red Hat Enterprise Linux 6 machine. Note that the first step can cause potential issues, so you should understand and weigh those up. You can skip the first step, it just means you will have to run global module installs (npm install -g ...) with elevated permissions (sudo/su).

  1. change owner of /usr/local so that npm install -g will Just Work. I think this has to go before installing node so that everything works properly.
sudo chown -R $USER /usr/local
@davidmason
davidmason / function-basics.rb
Last active August 29, 2015 14:18
Learning some basics of Ruby functions. Try it in http://repl.it/languages/Ruby
# This evening I got Ally (https://github.com/AllyG) to
# show me some basics for methods/functions in Ruby.
# I still have some major gaps in my mental model of all
# this, but I feel like I know a lot more than I did this
# morning.
def haldo name
puts "Haldo " + name
end
@davidmason
davidmason / pirates.elm
Last active April 16, 2020 04:04
Just playing around... or perhaps a comprehension challenge. Can you figure out what this code does? Try it in http://elm-lang.org/try
import Html exposing (text)
main = drink rum ye scurvies |> yarrrrrr
drink up me hearties =
case hearties of
[] -> me
capn :: lads -> drink up me lads |> up capn
yarrrrrr = text << String.fromInt
@davidmason
davidmason / graphics-play.elm
Created December 1, 2015 09:09
playing around with Elm graphics to see what sort of things I can do
import Color exposing (..)
import Graphics.Collage exposing (..)
import Graphics.Element exposing (..)
import Time exposing (fps)
import Transform2D exposing (scaleX)
framerate = 100.0
cow = image 24 28 "http://i.neoseeker.com/cm/42/badges/BCow2.png"
chicken = image 40 40 "http://fogu.com/hm/snes/img/chicken.gif"
@davidmason
davidmason / simple-html5-template.html
Created August 1, 2016 00:44
Simple HTML5 template.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Commonly used HTML things</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
@davidmason
davidmason / monitor-sizes.html
Created September 27, 2016 00:53
Visualize a few different screen sizes, to help me decide on a laptop display size.
<!DOCTYPE html>
<html>
<head>
<!-- Useful screen size calculators: http://www.silisoftware.com/tools/screen.php -->
<style type="text/css">
body {