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
"""Sums all the even-valued Fibonacci numbers less than 4,000,000. | |
For more info, see http://projecteuler.net/index.php?section=problems&id=2 | |
""" | |
# Taken from the Python Decorator Library | |
class memoized(object): | |
"""Decorator that caches a function's return value each time it is called. | |
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
"""Finds the solution to Problem 1 from Project Euler. | |
For more details, see http://projecteuler.net/index.php?section=problems&id=1 | |
""" | |
def problem_one(): | |
"""Sum the natural numbers less than 1000 that are multiples of 3 or 5.""" | |
return sum([n for n in range(1000) if ((0 == n % 3) or (0 == n % 5))]) | |
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
$ brew install -vd stfl | |
==> Build Environment | |
CC: /usr/bin/cc => /usr/bin/gcc-4.2 | |
CXX: /usr/bin/c++ => /usr/bin/c++-4.2 | |
LD: /usr/bin/cc => /usr/bin/gcc-4.2 | |
CFLAGS: -O3 -w -pipe | |
CXXFLAGS: -O3 -w -pipe | |
MAKEFLAGS: -j4 | |
==> Downloading http://www.clifford.at/stfl/stfl-0.21.tar.gz | |
File already downloaded and cached to /Users/whg/Library/Caches/Homebrew |
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
require 'formula' | |
class Stfl < Formula | |
url 'http://www.clifford.at/stfl/stfl-0.21.tar.gz' | |
homepage 'http://www.clifford.at/stfl/' | |
md5 '888502c3f332a0ee66e490690d79d404' | |
depends_on 'ncursesw' | |
def install |
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
diff --git a/Makefile b/Makefile | |
index eb976b5..014c653 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -39,7 +39,7 @@ libstfl.a: public.o base.o parser.o dump.o style.o binding.o iconv.o \ | |
libstfl.so.$(VERSION): public.o base.o parser.o dump.o style.o binding.o iconv.o \ | |
$(patsubst %.c,%.o,$(wildcard widgets/*.c)) | |
- $(CC) -shared -Wl,-soname,$(SONAME) -o $@ $^ | |
+ $(CC) -shared -Wl,-install_name,$(SONAME) -o $@ $^ |
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
☿ hg push git+ssh://git@heroku.com:floating-river-9772.git ruby 1.9.3p194 | |
pushing to git+ssh://git@heroku.com:floating-river-9772.git/ | |
creating and sending data | |
["git-receive-pack 'floating-river-9772.git/'"] | |
! Invalid path. | |
! Syntax is: git@heroku.com:<app>.git where <app> is your app's name. | |
abort: git remote error: The remote server unexpectedly closed the connection. |
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
body { | |
background-color: #FFF; | |
background: url(%%ihead%%) 600px -100px fixed no-repeat; | |
} | |
.domain { | |
color: #111113; |
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 python | |
import timeit | |
def main(): | |
list_comp_t = timeit.Timer("y = [math.log10(num) for num in x]", setup="import math; x = [1500, 1049.8, 34, 351]") | |
map_t = timeit.Timer("z = map(math.log10, x)", setup="import math; x = [1500, 1049.8, 34, 351]") | |
# Use an absurdly high number of reps because the data is tiny and I want the numbers to be on a reasonably human timescale. | |
print list_comp_t.timeit(1000000) | |
print map_t.timeit(1000000) |
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
± heroku run bundle exec rake clean generate | |
Running `bundle exec rake clean generate` attached to terminal... up, run.1266 | |
rm -rf .pygments-cache/** .gist-cache/** .sass-cache/** source/stylesheets/screen.css | |
## Generating Site with Jekyll | |
create source/stylesheets/screen.css | |
Configuration from /app/_config.yml | |
Building site: source -> public | |
Liquid Exception: incompatible character encodings: UTF-8 and ASCII-8BIT in atom.xml | |
/app/vendor/bundle/ruby/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `join' | |
/app/vendor/bundle/ruby/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `render_all' |
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
.flair { | |
border: none !important; | |
top: 20px; | |
padding: 0px; | |
background: url(%%hawks-flair-partial%%); | |
display: inline-block; } | |
.flair-10sharpsmall { | |
background-position: 0 0; | |
width: 16px; |
OlderNewer