Skip to content

Instantly share code, notes, and snippets.

@necolas
necolas / Composite-Link.js
Created September 19, 2018 23:02
Next.js links with React Native for Web
@FrissAnalytics
FrissAnalytics / .block
Last active July 30, 2025 09:03
TopoJSON Collection
license: mit
@mgiacomini
mgiacomini / drilldown.js
Created August 29, 2018 20:09
How to drill down charts with ChartJS?
// https://stackoverflow.com/questions/51609922/how-to-drill-down-charts-with-chartjs
// https://stackoverflow.com/questions/26257268/click-events-on-pie-charts-in-chart-js
$(document).ready(function() {
var canvas = document.getElementById("myChart");
var ctx = canvas.getContext("2d");
var myNewChart = new Chart(ctx, {
type: 'pie',
data: data
});
@bradtraversy
bradtraversy / docker-help.md
Last active October 29, 2025 05:12
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@rsudip90
rsudip90 / directory_structure.txt
Last active November 23, 2021 23:07
working with MySQL JSON type in prepared statements using Go
go-mysql-json-ex/
|-- dbm/ // contains all database related operations
| |-- internal/ // internal only accessible to dbm
| | |-- base.go // contains db conf, manager
| | |-- prepsql.go // all prepared statements used in entire app
| |-- conn.go // db init, close API call
| |-- delete.go // delete db resource APIs
| |-- get.go // get db resource APIs
| |-- insert.go // insert db resource APIs
| |-- models.go // models in go representing db tables structrure
@rsudip90
rsudip90 / nullHandle_extends.go
Last active January 3, 2024 21:46
database rows null handling in go by extending types
package main
import (
"database/sql"
"encoding/json"
"fmt"
"log"
"time"
"github.com/go-sql-driver/mysql"
@dale3h
dale3h / jail.local
Created June 29, 2018 15:47
[fail2ban] Improved nginx-badbots
# Add to file: /etc/fail2ban/jail.local
[nginx-badbots]
enabled = true
port = http,https
filter = nginx-badbots
logpath = %(nginx_access_log)s
maxretry = 1
findtime = 604800
bantime = 604800
@everettcaleb
everettcaleb / client.go
Last active November 11, 2020 00:11
HMAC Token Authentication in Go, Python, and JavaScript
package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"fmt"
"net/http"
)
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active March 22, 2025 07:22
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip
# Unzip
unzip protoc-3.5.1-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/