Skip to content

Instantly share code, notes, and snippets.

View zenlor's full-sized avatar
⚖️
balancing terrain generation

Lorenzo Giuliani zenlor

⚖️
balancing terrain generation
View GitHub Profile
@zenlor
zenlor / nginx.conf
Created September 29, 2014 11:14
basic nginx config
server {
listen 80;
server_name experimental.dev;
root /Users/lorenzo/Code/padify-experimental/public;
try_files $uri $uri/index.html $uri.html @app;
# Node.js app
location @app {
@zenlor
zenlor / index.js
Created October 27, 2014 17:48
requirebin sketch
var texta = document.createElement("textarea")
var div = document.createElement("div")
document.body.appendChild(div)
var parse = require('xml-parser')
# Bad dockerfile
# a docker container should run only one command.
#
FROM node:0.10-slim
RUN mkdir -p /app
WORKDIR /app
RUN curl https://raw.githubusercontent.com/hecticjeff/shoreman/master/shoreman.sh > /bin/shoreman &&\
chmod +x /bin/shoreman
@zenlor
zenlor / bookmarklet
Last active August 29, 2015 14:13 — forked from mauricecruz/readme.md
(function(d, u) {
var s = d.createElement('script');
s.src = u;
s.async = !!1;
(d.head || d.getElementsByTagName('head')[0]).appendChild(s);
}(document, 'https://gist.githubusercontent.com/mauricecruz/d20345b25b5c3ca0a4d7/raw/3f0a90112026a1e51a401dcb2fe6f3ca7bf299c0/snippet.js'));
(function(d){var a=d.createElement("script");a.src="https://gist.githubusercontent.com/mauricecruz/d20345b25b5c3ca0a4d7/raw/3f0a90112026a1e51a401dcb2fe6f3ca7bf299c0/snippet.js";a.async=!0;d.head.appendChild(a);}(document))();
@zenlor
zenlor / onchange.sh
Last active August 29, 2015 14:15 — forked from shello/onchange.sh
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute a command
# when a file or directory is created, modified or deleted.
#
# Modified from the original by: Senko Rasic <senko.rasic@dobarkod.hr>
# https://gist.github.com/senko/1154509
#
# Requires:
# bash
#!/usr/bin/env bash
#
#
# rai.tv - mplayer per rai.tv :P
#
#~$> ./rai.tv.sh http://www.rai.tv/dl/RaiTV/programmi/media/ContentItem-6b72f482-f5bf-4d28-bb1a-f04d1f99a984.html?p=0
#
#cheers :)
#
PLIST=
module Sinatra
class Base
def call!(env)
@env = env
@request = Request.new(env)
@response = Response.new
@params = indifferent_params(@request.params)
force_encoding(@params)
@zenlor
zenlor / app.rb
Created April 15, 2011 12:48
app.rb
require 'sinatra/base'
require 'padrino-helpers'
class SimpleObject
attr_accessor :foo, :bar, :moo, :goo
end
class App < Sinatra::Base
register Padrino::Helpers
@zenlor
zenlor / app.rb
Created April 15, 2011 12:49
Padrino form_for bug ?
require 'sinatra/base'
require 'padrino-helpers'
class SimpleObject
attr_accessor :foo, :bar, :moo, :goo
end
class App < Sinatra::Base
register Padrino::Helpers
Rubinius Crash Report #rbxcrashreport
Error: signal SIGSEGV
[[Backtrace]]
0 rbx 0x000000010000f1d0 _ZN8rubiniusL12segv_handlerEi + 160
1 libSystem.B.dylib 0x00007fff883df66a _sigtramp + 26
2 ??? 0x00007fff5fbf36e0 0x0 + 140734799754976
3 libSystem.B.dylib 0x00007fff883c0ad7 vsnprintf + 355
4 rbx 0x00000001001a7173 rb_raise + 211