Skip to content

Instantly share code, notes, and snippets.

@dmajda
dmajda / indentation-based.pegjs
Created November 27, 2015 15:00
Simple intentation-based language PEG.js grammar
/*
* Simple Intentation-Based Language PEG.js Grammar
* ================================================
*
* Describes a simple indentation-based language. A program in this language is
* a possibly empty list of the following statements:
*
* * S (simple)
*
* Consists of the letter "S".
@heyjohnmurray
heyjohnmurray / React accessing child properties
Created November 22, 2015 06:28
In React you can access the inner HTML or the value of a nested component using this.props.children
var App = React.createClass({
render: function() {
// notice that we have the "Button" and "Heart" components
return <Button>I <Heart /> React</Button>
}
});
var Button = React.createClass({
render: function() {
// notice that this.props.children gave us the value of both the "Button" and the "Heart" component
#!/usr/bin/env python
# This is an example Git server. http://blog.nerds.kr/post/106956608369/implementing-a-git-http-server-in-python
# Stewart Park <stewartpark92@gmail.com>
from flask import Flask, make_response, request, abort
from StringIO import StringIO
from dulwich.pack import PackStreamReader
import subprocess, os.path
from flask.ext.httpauth import HTTPBasicAuth
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl