Skip to content

Instantly share code, notes, and snippets.

@somic
somic / udp_hole_punch_tester.py
Created November 3, 2009 04:13
UDP Hole Punching test tool
#!/usr/bin/env python
#
# udp_hole_punch_tester.py - UDP Hole Punching test tool
#
# Usage: udp_hole_punch_tester.py remote_host remote_port
#
# Run this script simultaneously on 2 hosts to test if they can punch
# a UDP hole to each other.
#
# * remote_port should be identical on 2 hosts.
@eleclerc
eleclerc / solarized-light-markdown.diff
Created February 18, 2012 01:05
Markdown support in Solarized (Light) in Sublime Text 2 - 2165
--- Color Scheme - Default/Solarized (Light).tmTheme 2012-02-08 19:39:09.000000000 -0500
+++ User/Solarized (Light).tmTheme 2012-02-13 19:26:32.000000000 -0500
@@ -1368,17 +1368,6 @@
</dict>
<dict>
<key>name</key>
- <string>Markdown: Raw</string>
- <key>scope</key>
- <string>text.html.markdown markup.raw.inline</string>
- <key>settings</key>
@hrldcpr
hrldcpr / tree.md
Last active June 8, 2024 18:11
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@vastdevblog
vastdevblog / ExampleServer.scala
Created March 12, 2012 14:30
Example of a Finagle server
package com.vast.example
import java.net.InetSocketAddress
import java.util.UUID
import java.util.concurrent.{Executors, TimeUnit}
import com.google.common.base.Splitter
import com.twitter.finagle.http.Http
import com.twitter.finagle.builder.{Server, ServerBuilder}
import com.twitter.finagle.service.TimeoutFilter
import com.twitter.finagle.{Service, SimpleFilter, GlobalRequestTimeoutException}
@travmik
travmik / MC_shortcuts.md
Created January 14, 2013 13:52
Midnight Commander aka MC shortcuts for OS X
----- Esc -----
Quick change directory Esc + c
Quick change directory history Esc + c and then Esc + h
Quick change directory previous entry Esc + c and then Esc + p
Command line history Esc + h
Command line previous command Esc + p
View change Esc + t
Print current working directory in command line Esc + a
Switch between background command line and MC Ctrl + o
@roxlu
roxlu / X264Encoder.cpp
Created June 26, 2013 21:01
X264 encoder example
#include <roxlu/core/Log.h>
#include <roxlu/core/Utils.h>
#include <video/X264Encoder.h>
X264Encoder::X264Encoder()
:in_width(0)
,in_height(0)
,in_pixel_format(AV_PIX_FMT_NONE)
,out_width(0)
,out_height(0)
@sigman78
sigman78 / l15decode.py
Last active December 19, 2015 18:09
Convert L15 raw to 8 bit pgm
#!/usr/bin/env python
"""l15decode.py: L15 image format decoder."""
import os, sys
from time import time
import array
NUMPY = False
try:
@3noch
3noch / Either.h
Last active July 9, 2020 15:27
An implementation of Haskell's "Either" type C++
#pragma once
#include <boost/optional.hpp>
/**
* Wraps any value with a context of Left for the Either class.
*
* By convention, Left represents some sort of less-desired condition.
*/
@yihuang
yihuang / uwsgi-gevent-benchmark.rst
Last active July 17, 2019 10:20
uwsgi gevent benchmark
CPU:Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz (X8)
OS:debian7
PYTHON:python2.7.3
GEVENT:gevent-1.0rc1
UWSGI:1.9.15-dev

hello world