Skip to content

Instantly share code, notes, and snippets.

View wallyqs's full-sized avatar
🌎

Waldemar Quevedo wallyqs

🌎
  • Synadia Communications, Inc.
  • San Francisco
  • X @wallyqs
View GitHub Profile
import tornado.httpserver
import tornado.ioloop
import tornado.web
import mapnik
from twcache import TWCache
from sphericalmercator import SphericalMercator
class TileHandler(tornado.web.RequestHandler):
def get(self, datafile, mapfile, z, x, y):
@fwielstra
fwielstra / api.js
Created June 14, 2011 14:46
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
@morgant
morgant / gist:1753095
Created February 6, 2012 16:25
Building GnuTLS on Mac OS X

Preparing the Build Environment

cd ~/Desktop
mkdir wget-build
cd wget-build

Building & Installing GMP 5.0.2

@jboner
jboner / latency.txt
Last active July 3, 2024 14:57
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
$ sudo gdb -p 1711
(gdb) p creat("/tmp/stacktrace", 0755)
$3 = 128
(gdb) p dup2(128, 1)
$4 = 1
(gdb) detach
$ sudo kill -QUIT 1711
@ewoodh2o
ewoodh2o / a_description.md
Created October 3, 2012 19:50
Bash-Style Curly Brace Expansion

Bash-Style Curly Brace Expansion

Expands the curly-brace notation as supported by Bash.

expand "ab{c,d}e"
  => [ "abce", "abde" ]

expand "ab{c,d}e{1,2}"
 => [ "abce1", "abce2", "abde1", "abde2" ]
class ItemsController < ApplicationController
RWS_URL = 'https://app.rakuten.co.jp'
def index
items = http_get({'keyword' => params['keyword']})
render :json => items
end
private

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@bergundy
bergundy / stdin_byte_reader.py
Last active December 19, 2015 06:49
An example of how to use coroutines with IOStream.read and timeouts
import sys
import functools
import termios
import socket
from tornado import gen, ioloop, iostream
from datetime import timedelta
class StdinReader(object):
@guenter
guenter / Main.scala
Last active September 17, 2020 11:25
A simple Mesos "Hello World": downloads and starts a Python web server on every node in the cluster.
import mesosphere.mesos.util.FrameworkInfo
import org.apache.mesos.MesosSchedulerDriver
/**
* @author Tobi Knaup
*/
object Main extends App {