Skip to content

Instantly share code, notes, and snippets.

View pikeas's full-sized avatar

Aris Pikeas pikeas

  • San Francisco, CA
View GitHub Profile
@pikeas
pikeas / gist:1240388
Created September 25, 2011 08:36
Callback confusion 2
#I'm trying to write a wrapper function to use in place of long nested callbacks like a(b(c())).
runner = (cb, args...) ->
puts 'run'
cb(args...)
a = (cb, args...) ->
puts 'a'
cb(args...)
@pikeas
pikeas / gist:1273832
Created October 9, 2011 15:58
Unbound variable?
def foo():
a = 10
def _foo():
print a
_foo()
#Outputs 10
def foo():
@pikeas
pikeas / gist:1273891
Created October 9, 2011 16:38
Recursion depth exceeded
class Node:
def __init__(self, b, e, data, L, R):
self.b = b
self.e = e
self.L = L
self.R = R
self.data = data
@pikeas
pikeas / gist:1273904
Created October 9, 2011 16:50
Recursive fail
class SegmentTree:
def __init__(self, N, quads):
def _init(b, e):
if b is e:
q = [0] * 4
q[quads[b]] = 1
return Node(b, e, q, None, None)
else:
mid = (b + e ) / 2
#Replace readline() with raw_input for actual submission
f = open('test')
N = int(f.readline())
points = [f.readline() for i in xrange(N)]
Q = int(f.readline())
moves = [f.readline() for i in xrange(Q)]
for i in xrange(N):
Take 2:
vendor/
TesseractStatic/
(all .h files)
liblept.a
libtesseract_all.a
Rakefile
app.vendor_project('vendor/TesseractStatic', :static)
require 'ipaddr'
require 'ostruct'
require 'yaml'
SETTINGS = OpenStruct.new(YAML.load_file(File.expand_path('../vagrant.yaml', __FILE__)))
CLOUD_CONFIG_PATH = File.expand_path('../user-data.yaml', __FILE__)
ERROR in ./app/Main.jsx
Module parse failed: /Users/pikeas/Documents/code/pypjs/crypto/front/react-starter/app/Main.jsx Line 19: Unexpected token <
You may need an appropriate loader to handle this file type.
| var Application = React.createClass({
| render: function() {
| return <Example />;
| }
| });
@ ./config/app.jsx?Main 4:18-64
# Bad config
/***/ 128:
/*!************************!*\
!*** ./app/style.styl ***!
\************************/
/***/ function(module, exports, __webpack_require__) {
module.exports =
"body {\n background: #eef;\n}\nhtml,\nbody {\n height: 100%;\n margin: 0;\n}\n";
# Relevant bits only
{
entry: {
main: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
...
]
vendor: ['jquery', 'react', 'reflux', 'react/lib/ReactComponentBrowserEnvironment']