Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View joyrexus's full-sized avatar

J. Voigt joyrexus

View GitHub Profile
@joyrexus
joyrexus / Cakefile
Created March 8, 2013 17:21
index2README task for simple litcoffee modules
{spawn} = require 'child_process'
fs = require 'fs'
task "build", "watch and build the source", ->
compiler = spawn 'coffee', ['-cw', '.']
compiler.stdout.on 'data', (data) -> console.log data.toString().trim()
compiler.stderr.on 'data', (data) -> console.error data.toString().trim()
# Render your literate source as a GH-highlight-able code-fenced README (a tweak of journo's Cakefile)
task "readme", "render index as README", ->
@joyrexus
joyrexus / Cakefile
Last active December 14, 2015 19:08
Simple test task and runner for your Cake files.
task 'test', 'run the test suite', ->
runTests()
# Simple test runner, ripped from the docco Cake file.
runTests = ->
global.Main = require './main' # rename/require module to be tested
require 'coffee-script'
startTime = Date.now()
currentFile = null
currentTest = null
@joyrexus
joyrexus / .bash_profile
Last active December 14, 2015 19:08
My base bash environment.
# My base ~/.bash_profile
SHELL=/bin/bash
PS1='\[\033[0;32m\]\w\[\033[0;33m\]$\[\033[0m\] ' # colored version of '\w\$ '
PS2='> '
ENV=~/.bashrc
PROFILE=~/.bash_profile
PATH=.:/usr/local/share/python:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/
sbin:/usr/X11/bin:/usr/texbin
@joyrexus
joyrexus / selectors.css
Created March 12, 2013 14:03
Overview of basic CSS selectors.
/* basic */
#foo {} /* id */
.bar {} /* class */
a#foo.bar {} /* element attribute combinations */
/* attributes */
#foo a[href] {} /* simple */
#foo a[href=bar] {} /* attribute values */
#foo a[lang|=en] {} /* subcodes */
#foo a[title~=hello] {} /* attribute contains */
@joyrexus
joyrexus / quick.coffee.html
Created March 12, 2013 21:54
Sample of literate coffeescript rendered with marko's minimalist styling.
<!DOCTYPE html>
<meta charset="utf-8">
<style>
@import url(http://fonts.googleapis.com/css?family=Source+Code+Pro:200,400,600);
html {
min-width: 1040px;
}
body {
@joyrexus
joyrexus / quick.coffee.md
Created March 12, 2013 21:55
Literate CoffeeScript sample.

Quick Coffee

Examples and such to accompany J. Ashkenas' dotJS talk.

Preliminaries

{ok} = require 'assert'
@joyrexus
joyrexus / quick.markdown.md
Created March 12, 2013 22:03
A quick overview of Markdown.
@joyrexus
joyrexus / select.coffee.md
Last active December 14, 2015 20:59
Simple jquery replacment for simple selections.

Simple Selections

Selecting (without jquery)

Return first element matching css selector pattern (on a node).

$ = (p, node) ->
@joyrexus
joyrexus / demo.txt
Last active October 19, 2018 22:25
Demonstrate how to extract and run code blocks from *.lang.md* files.
% marko.coffee -x try.python.md > try.py
% python try.py
hello world!
yes!
% marko.coffee -x try.python.md | python -s
hello world!
yes!
@joyrexus
joyrexus / Makefile
Last active December 15, 2015 00:29
Makefile and init script for building/versioning a simple data backend.
# Makefile for building/versioning data backend
VERSION := $(shell cat VERSION)
.PHONY: svn all clean
all: svn joy.db update
svn:
svn update