GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scraperwiki | |
import urllib2 | |
import lxml.etree | |
''' | |
Code to pull data out of the timing related press releases issued by FIA for Formula One races. | |
This code is provided solely for your own use, without guarantee, so you can publish F1 timing data, | |
according to license conditions specified by FIA, | |
without having to rekey the timing data as published on the PDF press releases yourself. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns express_sample | |
(:require [cljs.nodejs :as node])) | |
(def express (node/require "express")) | |
(def app (. express (createServer))) | |
(defn -main [& args] | |
(doto app | |
(.use (. express (logger))) | |
(.get "/" (fn [req res] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Datomic example code | |
(use '[datomic.api :only (db q) :as d]) | |
;; ?answer binds a scalar | |
(q '[:find ?answer :in ?answer] | |
42) | |
;; of course you can bind more than one of anything | |
(q '[:find ?last ?first :in ?last ?first] | |
"Doe" "John") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
namespace System.Numerics | |
{ | |
public struct BigDecimal : IConvertible, IFormattable, IComparable, IComparable<BigDecimal>, IEquatable<BigDecimal> | |
{ | |
public static readonly BigDecimal MinusOne = new BigDecimal(BigInteger.MinusOne, 0); | |
public static readonly BigDecimal Zero = new BigDecimal(BigInteger.Zero, 0); | |
public static readonly BigDecimal One = new BigDecimal(BigInteger.One, 0); |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download from: http://downloads.datomic.com/free.html | |
curl -O http://downloads.datomic.com/0.8.3488/datomic-free-0.8.3488.zip | |
unzip datomic-free-0.8.3488.zip | |
cd datomic-free-0.8.3488/ | |
# From: http://docs.datomic.com/getting-started.html | |
# Run the transactor | |
bin/transactor config/samples/free-transactor-template.properties | |
# Should say: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def C | |
(contract | |
foo | |
"bar" | |
[f n] | |
[(integer? n) | |
(_ f [n] [odd?]) | |
=> | |
integer?])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Comments start with semicolons. | |
; Clojure is written in "forms", which are just | |
; lists of things inside parentheses, separated by whitespace. | |
; | |
; The clojure reader assumes that the first thing is a | |
; function or macro to call, and the rest are arguments. | |
; | |
; Here's a function that sets the current namespace: | |
(ns test) |
OlderNewer