Skip to content

Instantly share code, notes, and snippets.

View thiagozs's full-sized avatar
:octocat:
Have a nice day

Thiago Zilli Sarmento thiagozs

:octocat:
Have a nice day
View GitHub Profile
<!-- Game canvas -->
<canvas id="c"></canvas>
<!-- Gameplay HUD -->
<div class="hud">
<div class="hud__score">
<div class="score-lbl"></div>
<div class="cube-count-lbl"></div>
</div>
<div class="pause-btn"><div></div></div>
@thiagozs
thiagozs / bluetooth-reconnect
Created April 24, 2023 14:11 — forked from AndBondStyle/bluetooth-reconnect
Simple linux service for brute-force bluetooth auto-connection
#!/bin/bash
# Miminum delay between iterations, in seconds
delay=10
# Pairs of [bluetooth MAC, test expression]
targets=(
"98:B6:E9:47:F0:4F" "test ! -e /dev/input/js0"
"98:B6:E9:72:6C:31" "test -z \"\$(bluetoothctl info 98:B6:E9:72:6C:31 | grep 'Connected: yes')\""
)
@thiagozs
thiagozs / 0_reuse_code.js
Created September 17, 2016 16:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
package main
import (
"fmt"
"github.com/codegangsta/negroni"
"github.com/julienschmidt/httprouter"
"net/http"
)
func main() {
@thiagozs
thiagozs / countries.js
Created May 27, 2016 13:27 — forked from mrrooijen/countries.js
A list of country codes and names
COUNTRIES = {
"US": "United States",
"AF": "Afghanistan",
"AX": "Åland Islands",
"AL": "Albania",
"DZ": "Algeria",
"AS": "American Samoa",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
@thiagozs
thiagozs / gitlab_backup
Created May 27, 2016 13:25 — forked from mrrooijen/gitlab_backup
Generates, encrypts, transfers and rotates Gitlab backups to/on Amazon S3.
#! /bin/bash
# Generates, encrypts, transfers and rotates Gitlab backups to/on Amazon S3.
# Requirements:
#
# 1. Gitlab
#
# $ apt-get update
@thiagozs
thiagozs / rancher_backup
Created May 27, 2016 13:25 — forked from mrrooijen/rancher
Dumps, compresses, encrypts, transfers, and rotates Rancher backups to/on Amazon S3.
#! /bin/bash
# Dumps, compresses, encrypts, transfers, and rotates Rancher backups to/on Amazon S3.
# Requirements:
#
# 1. Docker
#
# $ curl -fsSL https://get.docker.com/ | sh
@thiagozs
thiagozs / LimitStream.js
Created May 6, 2016 14:51 — forked from 4poc/LimitStream.js
Node.js: LimitStream (Bandwidth limited Readable+Writable Stream)
var fs = require('fs'),
util = require('util'),
Stream = require('stream').Stream;
/**
* Create a bandwidth limited stream
*
* This is a read+writeable stream that can limit how fast it
* is written onto by emitting pause and resume events to
* maintain a specified bandwidth limit, that limit can