Skip to content

Instantly share code, notes, and snippets.

View simpleton's full-sized avatar
👷‍♂️
Hello World

Sim Sun simpleton

👷‍♂️
Hello World
View GitHub Profile
@simpleton
simpleton / consumer.go
Last active October 19, 2023 05:17
Golang auto-reconnect rabbitmq consumer
package base
import (
"errors"
"fmt"
"github.com/manucorporat/try"
"github.com/simpleton/beego"
"github.com/streadway/amqp"
"math/rand"
"model/helper"
@sjlongland
sjlongland / amqp.py
Last active November 14, 2018 14:13
Tornado Coroutine interface to AMQP (pika)
#!/usr/bin/python
import datetime
import logging
import threading
import weakref
import tornado
import tornado.gen
import pika
@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing
@aarti
aarti / git_prune_branches
Created February 20, 2014 21:37
Delete unused git branches
→ git remote prune origin
→ git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
# Remember to do this from the master branch
# If you run it from a feature branch the master branch gets deleted.
→ git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
Deleted branch master (was 644eb76).
You can recheckout master branch
→ git checkout -b master origin/master
@kristopherjohnson
kristopherjohnson / git-flow-cheatsheet.md
Last active October 3, 2022 11:19
git-flow Snippets
@jqlblue
jqlblue / sentry-nginx.conf
Last active December 31, 2015 17:19
sentry nginx config for proxy and limit req
user nobody;
worker_processes auto;
error_log logs/error.log notice;
worker_rlimit_nofile 65535;
pid /var/run/nginx.pid;
events {
accept_mutex off;
@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active April 23, 2024 12:01
5 entertaining things you can find with the GitHub Search API
@philipcristiano
philipcristiano / tornado_queue_connection.py
Last active January 3, 2019 03:23
Simple Tornado/Pika wrapper. Part of an internal library so it raises an error on init instead of importing
try:
import pika
from pika.adapters.tornado_connection import TornadoConnection
except ImportError:
pika = None
try:
import tornado
import tornado.ioloop
except ImportError:
@jvranish
jvranish / stack_traces.c
Last active April 17, 2024 16:25
An example of catching exceptions and printing stack traces in C on Windows, Linux and OS X
/* compile with:
on linux: gcc -g stack_traces.c
on OS X: gcc -g -fno-pie stack_traces.c
on windows: gcc -g stack_traces.c -limagehlp
*/
#include <signal.h>
#include <stdio.h>
#include <assert.h>