Skip to content

Instantly share code, notes, and snippets.

@glejeune
glejeune / READLE.md
Created November 12, 2011 20:43
A (very) simple chat service using MQTT

Run

  1. Install and run an MQTT server (mosquitto is a good choise)

  2. Install mqtt and ncurses-ruby gems

    sudo gem install ruby-mqtt ncurses-ruby

  3. Run the client

ruby ./mqtt-chat.rb

@mrosset
mrosset / clientDoGzip.go
Created March 16, 2012 15:45 — forked from elazarl/clientDoGzip.go
Client.Do will not uncompress response body
package main
// run this file with `go run clientDoGzip.go, and then file tmp.out to verify body is gzipped
import "compress/gzip"
import "net/http"
import "fmt"
import "io"
import "log"
import "os"
@adnbr
adnbr / max7219-basic.c
Last active November 23, 2023 23:09
Simple AVR code for using a MAX7219 7-segment display driver
/* MAX7219 Interaction Code
* ---------------------------
* For more information see
* http://www.adnbr.co.uk/articles/max7219-and-7-segment-displays
*
* 668 bytes - ATmega168 - 16MHz
*/
// 16MHz clock
#define F_CPU 16000000UL
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 24, 2024 17:56
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@johntyree
johntyree / getBlockLists.sh
Last active June 4, 2024 12:30
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
@jedy
jedy / go_scp.go
Last active May 31, 2022 07:20
an example of scp in golang
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"fmt"
"golang.org/x/crypto/ssh"
)
const privateKey = `content of id_rsa`
@daverogers
daverogers / footer.js
Created April 12, 2013 22:41
Assign "active" class to navbar item based on current page URL with jQuery
@liubin
liubin / cookie.go
Created June 4, 2013 12:44
display cookie in go lang
@mattetti
mattetti / multipart_upload.go
Last active July 18, 2024 17:31
Example of doing a multipart upload in Go (golang)
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
@jmoiron
jmoiron / valuer.go
Created October 14, 2013 18:03
Example uses of sql.Scanner and driver.Valuer
package main
import (
"bytes"
"compress/gzip"
"database/sql/driver"
"errors"
"fmt"
"github.com/jmoiron/sqlx"
_ "github.com/mattn/go-sqlite3"