When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
letters-to-100.py | |
""" | |
import string | |
letter_values = dict((l, i) for i, l in enumerate(string.lowercase, start=1)) | |
english_dict = open('/usr/share/dict/words', 'rU') |
=begin | |
Find pi by the Monte-Carlo method. | |
area of a circle = pi r^2 | |
area of a square = (2r)^2 = 4 r^2 | |
Perform random uniform sampling between -1 and 1. | |
The proportion of points in the unit circle is: | |
p = (pi r^2) / (4r^2) |
""" | |
This code computes pi. It's not the first python | |
pi computation tool that I've written. This program | |
is a good test of the mpi4py library, which is | |
essentially a python wrapper to the C MPI library. | |
To execute this code: | |
mpiexec -np NUMBER_OF_PROCESSES -f NODES_FILE python mpipypi.py |
''' listing 6: pi_mp.py | |
Multiprocessing based code to estimate the value of PI | |
using monte carlo sampling | |
Ref: http://math.fullerton.edu/mathews/n2003/montecarlopimod.html | |
Uses workers: | |
http://docs.python.org/library/multiprocessing.html#module-multiprocessing.pool | |
''' | |
import random |
#!/usr/bin/env python | |
def pi(): | |
# Wallis' product | |
numerator = 2.0 | |
denominator = 1.0 | |
while True: | |
yield numerator/denominator | |
if numerator < denominator: | |
numerator += 2 |
import functools | |
import random | |
import math | |
from concurrent import futures | |
def map_d(c): | |
return math.hypot(random.random(), random.random()) | |
// Original by C0D312 | |
// I added the single quote and curly brace to the regex. | |
// http://www.sublimetext.com/forum/viewtopic.php?f=3&t=5174 | |
// | |
// Add the following to your user keybindings: | |
[ | |
{ "keys": ["tab"], "command": "move", "args": {"by": "characters", "forward": true}, "context": | |
[ | |
{ "key": "following_text", "operator": "regex_contains", "operand": "^[)}'\"\\]]", "match_all": true }, |
// Node.js CheatSheet. | |
// Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
// Download: http://nodejs.org/download/ | |
// More: http://nodejs.org/api/all.html | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html | |