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
#header { | |
border-radius: 5px; | |
-webkit-border-radius: 5px; | |
-moz-border-radius: 5px; | |
} | |
#footer { | |
border-radius: 10px; | |
-webkit-border-radius: 10px; | |
-moz-border-radius: 10px; | |
} |
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
#!/usr/bin/env node | |
var fs = require('fs'); | |
var source = process.argv.splice(2)[0]; | |
var target = source.substring(0, source.lastIndexOf('.')) + '.css'; | |
fs.readFile(source, 'utf-8', function(err, data) { | |
if (err) throw err; | |
var analyze = function(input) { |
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
define(function() { | |
return { | |
meta: { | |
tooltip: 'Drags the canvas around', | |
category: 'canvas' | |
}, | |
selected: function() { | |
var $elem = $$('.paintCursor')[0]; | |
this._oldPaintCursor = $elem.getStyle('cursor'); |
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
from __future__ import print_function | |
from functools import partial | |
from questions import boolean, choice, match | |
def ask(questions): | |
def _fill(i): | |
... # this just attaches some extra data to i so we can avoid checks later | |
def _input(): |
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 subprocess | |
import sys | |
def convert(source, from_format, to_format): | |
# original version: http://osiux.com/html-to-restructured-text-in-python-using-pandoc | |
# supported formats at http://johnmacfarlane.net/pandoc/ | |
# raises OSError if pandoc is not found! | |
p = subprocess.Popen(['pandoc', '--from=' + from_format, '--to=' + to_format], | |
stdin=subprocess.PIPE, stdout=subprocess.PIPE | |
) |
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
fibo = scan(0, 1, lambda a, b: a + b) # fibonacci sequence (iterator) | |
part = sliceable(fibo)[10:20] # let's slice that iterator to a list | |
# chaining func ops (just map, filter and reduce for now) | |
chainable([1, 2, 3]).map(lambda x: x * 2).filter(lambda x: x > 3).val() == [4, 6] |
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
function checkArguments(errors, errorPrefix, suppressWarning) { | |
errorPrefix = errorPrefix? errorPrefix + ': ': ''; | |
var gotError = false; | |
for(var argName in errors) { | |
// remember to attach forEach to Array or replace this with a more generic | |
// definition | |
errors[argName].forEach(function(check) { | |
if(check.invariant) { |
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
class InfList(object): | |
def __init__(self, *items): | |
self._rule = (lambda i, a, b: 2 * b - a) if len(items) == 2 else items[2] | |
self._items = list(items[0:2]) | |
def __getitem__(self, k): | |
if k >= len(self._items): | |
self._calc_items(k) | |
return self._items[k] |
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
Listening: http://127.0.0.0:3000 | |
Press Ctrl+C to hung up | |
Sending: /index.html (text/html) | |
Sending: /shared.css -> ~/.lovely/server/shared.css | |
Serving: /core.js -> ~/.lovely/packages/core/current/build/core-src.js | |
Error: Cannot find module 'stylus' | |
at Function._resolveFilename (module.js:320:11) | |
at Function._load (module.js:266:25) | |
at require (module.js:348:19) |
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
<?php | |
include('src/dwoo/dwooAutoload.php'); | |
/* | |
* This script converts a bunch of Dwoo templates to proper HTML. | |
* Execute it like this "php generate_site.php". | |
* | |
* Use this file to inject variables to your templates. In order to make it | |
* easier to deal with paths, I defined "pathPrefix" variable. It contains | |
* prefix relative to the root. This in turn may be used to get some nice |