Skip to content

Instantly share code, notes, and snippets.

@gthank
gthank / gist:8060790
Created December 20, 2013 20:18
Error from jython-ssl when trying to install setup tools
../../dist/bin/jython ez_setup.py
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-2.0.1.tar.gz
Extracting in /var/folders/z0/0wnmjqt16pg547qwlmcw0xdw0000gp/T/tmpiUmmta
Now working in /var/folders/z0/0wnmjqt16pg547qwlmcw0xdw0000gp/T/tmpiUmmta/setuptools-2.0.1
Installing Setuptools
Traceback (most recent call last):
File "setup.py", line 200, in <module>
dist = setuptools.setup(**setup_params)
File "/Users/whg/dev/jython-ssl/dist/Lib/distutils/core.py", line 112, in setup
_setup_distribution = dist = klass(attrs)
@gthank
gthank / snippet.html
Created December 12, 2013 18:29
sample combobox and store
<div data-dojo-type="dojo/store/Memory"
data-dojo-id="vendorStore"
data-dojo-props="[{id: 'spam', name: 'spam'}, {id: 'ham', name: 'ham'}, {id: 'eggs', name: 'eggs'}]">
</div>
<!-- SNIP -->
<input
name="stuffAndStuff"
id="stuffAndStuff"
class="actualExpenseVendorControl"
data-dojo-type="dijit/form/ComboBox"
@gthank
gthank / gist:7909669
Created December 11, 2013 12:35
matplotlib fails to install, because of some (missing?) freetype headers
whg@hanks-mbp:~|⇒ brew doctor
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
@gthank
gthank / flair.css
Created July 24, 2013 14:18
balky flair CSS
.flair {
border: none !important;
top: 20px;
padding: 0px;
background: url(%%hawks-flair-partial%%);
display: inline-block; }
.flair-10sharpsmall {
background-position: 0 0;
width: 16px;
± 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'
@gthank
gthank / micro.py
Created July 25, 2012 19:54
list_comp vs. map
#! /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)
@gthank
gthank / hawks.css
Created July 2, 2012 11:05
Hawks CSS, part deux
body {
background-color: #FFF;
background: url(%%ihead%%) 600px -100px fixed no-repeat;
}
.domain {
color: #111113;
☿ 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.
@gthank
gthank / patch-Makefile.diff
Created January 25, 2011 17:07
Patch to make stfl's Makefile work on OS X
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 $@ $^
@gthank
gthank / stfl.rb
Created January 25, 2011 16:25
My effort at a formula for STFL
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