Skip to content

Instantly share code, notes, and snippets.

View orangle's full-sized avatar
🎯
Focusing

orangleliu orangle

🎯
Focusing
View GitHub Profile
/*
* $Id: simple-tcp-proxy.c,v 1.6 2002/11/27 00:40:31 wessels Exp $
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <netdb.h>
#include <string.h>
#include <signal.h>
@alexaandru
alexaandru / about.md
Last active July 31, 2017 11:16
Minimal Golang web stack.

Mini Go Web Stack

Description

This represents a proof of concept, minimal web stack. I used http://nicolasmerouze.com/build-web-framework-golang/ series of articles as a starting point and the goal was to keep the stack as minimal as possible while still being useful for practical purposes. And of course, use the standard library as much as possible and only integrate components compatible with it.

@LPGhatguy
LPGhatguy / luajit-curl.lua
Last active July 26, 2025 17:38
A cURL binding for LuaJIT. Missing some constants presumably, but functional
--[[
LuaJIT-cURL
Lucien Greathouse
LuaJIT FFI cURL binding aimed at cURL version 7.38.0.
Copyright (c) 2014 lucien Greathouse
This software is provided 'as-is', without any express
or implied warranty. In no event will the authors be held
liable for any damages arising from the use of this software.
@hamaluik
hamaluik / markdown_thirdparty.py
Created September 25, 2014 23:58
A Pelican plugin to enable third party Markdown extensions
# -*- coding: utf-8 -*-
"""
Markdown Third Party
============================
This plugin allows you to use various third-party
Markdown extensions to make writing posts in Markdown
easier and better.
"""
@theacodes
theacodes / logserver.py
Created September 6, 2014 18:29
Gevent based log server
#!/usr/bin/env python
from gevent import monkey
monkey.patch_all()
monkey.patch_sys(stdin=True, stdout=False, stderr=False)
import gevent
from gevent.queue import Queue
import signal
import sys
from socketio.namespace import BaseNamespace
@yihuang
yihuang / redis_asyncio.py
Last active August 3, 2020 11:01
benchmark gevent vs asyncio on python3.4
import asyncio
import hiredis
d = {}
def process(req):
cmd = req[0].lower()
if cmd==b'set':
d[req[1]] = req[2]
return b"+OK\r\n"
@sriram-mv
sriram-mv / async_requests.py
Created July 15, 2014 18:26
Uasge of asyncio with requests
import asyncio
import requests
def fetch_page(url, idx):
#loop = asyncio.get_event_loop()
url = 'https://bing.com'
future = loop.run_in_executor(None, requests.get, 'http://www.bing.com')
response = yield from future
if response.status_code == 200:
print("data fetched successfully for: %d" % idx)
@staltz
staltz / introrx.md
Last active December 1, 2025 11:31
The introduction to Reactive Programming you've been missing
@tristanwietsma
tristanwietsma / auth.go
Created May 15, 2014 04:15
Golang web server example
package main
import (
"encoding/base64"
"net/http"
"strings"
)
type handler func(w http.ResponseWriter, r *http.Request)
@john2x
john2x / uwsgi-emperor
Last active May 19, 2016 23:41
uWSGI Emperor init script (Ubuntu 12.04)
#!/bin/sh
### BEGIN INIT INFO
# Provides: uwsgi-emperor
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the uwsgi emperor app server
# Description: starts uwsgi app server using start-stop-daemon