Skip to content

Instantly share code, notes, and snippets.

View jkuri's full-sized avatar
🏠
Working from home

Jan Kuri jkuri

🏠
Working from home
View GitHub Profile
@snatchev
snatchev / libuv-tcp-client.c
Created March 27, 2013 16:55
a libuv evented tcp client
#include <stdio.h>
#include <uv.h>
static void on_close(uv_handle_t* handle);
static void on_connect(uv_connect_t* req, int status);
static void on_write(uv_write_t* req, int status);
static uv_loop_t *loop;
static uv_buf_t alloc_cb(uv_handle_t* handle, size_t size) {
@arq5x
arq5x / test.sh
Last active November 30, 2023 12:50
Compress and then Decompress a string with zlib.
# compile
$ g++ zlib-example.cpp -lz -o zlib-example
# run
$ ./zlib-example
Uncompressed size is: 36
Uncompressed string is: Hello Hello Hello Hello Hello Hello!
----------
@bodokaiser
bodokaiser / libuv_tcp_echo_server.c
Last active May 30, 2021 10:10
Simple TCP echo server implemented with libuv.
#include <uv.h>
#include <stdio.h>
#include <stdlib.h>
/**
* Our tcp server object.
*/
uv_tcp_t server;
/**
@russelldavies
russelldavies / hterm_solarized.js
Last active May 7, 2021 18:31
Chrome/Chromium OS hterm and Secure Shell solarized color scheme.
// Run in the JavaScript console of the hterm browser window
// Clear all existing settings - you probably don't want to do this.
// Preferences are now stored in "chrome.storage.sync" instead of
// "window.localStorage" so if you clear your preferences the changes
// will be propagated to other devices.
//term_.prefs_.storage.clear();
var htermProfiles = [
@ogrrd
ogrrd / dnsmasq OS X.md
Last active June 5, 2024 20:47
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@JalfResi
JalfResi / revprox.go
Last active June 7, 2024 05:18
Simple reverse proxy in Go
package main
import(
"log"
"net/url"
"net/http"
"net/http/httputil"
)
func main() {
// First: go get github.com/golang/glog
// Then : go test -v -vmodule=*=3 -logtostderr netgrace_test.go
// This test package shows how to gracefully shutdown a net.Listener.
package netgrace
import (
"bufio"
"fmt"
"github.com/golang/glog"
@simonista
simonista / .vimrc
Last active June 7, 2024 15:24
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@taichi
taichi / main.go
Last active May 19, 2020 08:01
RethinkDB Client code examples written by golang.
package main
import (
r "github.com/dancannon/gorethink"
"log"
"time"
)
func main() {
log.Println("BEGIN")
@Liryna
Liryna / ARMDebianUbuntu.md
Last active May 20, 2024 15:04
Emulating ARM on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux