Skip to content

Instantly share code, notes, and snippets.

paulsmith / echo.go
Created Jan 12, 2011
A simple echo server testing a few interesting Go language features, goroutines and channels.
View echo.go
// $ 6g echo.go && 6l -o echo echo.6
// $ ./echo
// ~ in another terminal ~
// $ nc localhost 3540
package main
import (
kikairoya /
Last active Aug 2, 2020
SEH for gcc
Copyright (c) 2012- kikairoya
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
kares / gammusms2android.rb
Created Mar 8, 2012
Gammu to Android SMS converter. Assumes your backup has been exported as XML.
View gammusms2android.rb
#!/usr/bin/evn ruby
# (Not just) Nokia 2 Android SMS converter script.
# This tool assumes you've backed up your SMS messages from your device using
# Gammu (Wammu) in XML format e.g.
# * open Wammu and connect your phone: Phone -> Connect
# * retrieve messages (or all) using: Retrieve -> Messages
# * backup as XML using: Backups -> Export messages to XML
zziuni / stuns
Created Sep 18, 2012
STUN server list
View stuns
# source :
# A list of available STUN server.
st4lk /
Last active Nov 24, 2021
Python: ( audio music downloader
# -*- coding: utf-8 -*-
Скрипт для скачивания музыки с сайта (
Принцип работы:
Скрипт проверяет сохраненный access_token. Если его нет или срок истек,
то открывается страница в браузере с запросом на доступ к аккаунту.
nhatminhle / stdatomic.h
Last active Oct 31, 2020
A portable version of stdatomic.h extracted from the FreeBSD libc, for Clang 3.1+ and GCC 4.7+.
View stdatomic.h
* An implementation of C11 stdatomic.h directly borrowed from FreeBSD
* (original copyright follows), with minor modifications for
* portability to other systems. Works for recent Clang (that
* implement the feature c_atomic) and GCC 4.7+; includes
* compatibility for GCC below 4.7 but I wouldn't recommend it.
* Caveats and limitations:
* - Only the ``_Atomic parentheses'' notation is implemented, while
* the ``_Atomic space'' one is not.
aras-p / preprocessor_fun.h
Last active Dec 7, 2021
Things to commit just before leaving your job
View preprocessor_fun.h
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
yetithefoot / stuns
Last active Dec 1, 2021 — forked from zziuni/stuns
STUN+TURN servers list
View stuns
jdxcode / boot.js
Last active May 25, 2021
zero-downtime node.js app runner
View boot.js
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
var cluster = require('cluster');
var workerCount = process.env.WORKER_COUNT || 2;
// Defines what each worker needs to run
lpereira / gist:c0bf3ca3148321395037
Created Jun 23, 2014
Integer to string conversion benchmark
View gist:c0bf3ca3148321395037
#include <chrono>
#include <cstdint>
#include <iostream>
#include <random>
#include <sstream>
using namespace std;
using namespace std::chrono;
const uint64_t P01 = 10;