Skip to content

Instantly share code, notes, and snippets.

View 0xRichardH's full-sized avatar
🍉

Richard Hao 0xRichardH

🍉
View GitHub Profile
@tenderlove
tenderlove / ngpng.rb
Last active December 12, 2020 14:09
Simple PNG generation example that only depends on zlib in Ruby
# Not Great PNG class. This is a very simple example of writing a PNG. It
# only supports colors from the color palette stored in `@palette`. This is
# meant to be example code, but I am using it in a program for visualizing
# heap dumps from Ruby.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@levelsio
levelsio / canggu.geojson
Created August 25, 2019 12:52
canggu.geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ArmandoKenneth
ArmandoKenneth / gist:8c9ddbf5dab589a672f9427424b2b1ba
Last active May 20, 2025 09:56
Sign all previous unsigned commits
1. Use git log --show-signature to see what commigs you have
2. Get the commit hash of the last commit you want to sign (this will make the command stop at the given hash, will include it in the new signed commit)
GIT_EDITOR=true git rebase --exec 'git commit --amend --no-edit -n -S' -i LAST_COMMIT_HASH_YOU_WANT_TO_SIGN
@mrmartineau
mrmartineau / stimulus.md
Last active October 5, 2025 14:09
Stimulus cheatsheet
@okeehou
okeehou / outline-server-setup.md
Last active November 13, 2024 04:51
How to setup an Outline VPN Server on Ubuntu 16.04

How to setup an Outline VPN Server on Ubuntu 16.04 Server

This guide will show you how to install Outline Server on an Ubuntu 16.04 Server, use Outline Manager for Windows and connect to your Outline Server on Windows and Anroid.

Install Outline Manager

Outline Manager supports Windows, macOS and Linux.

Outline Manager for Windows

@koop
koop / ensure-cert-macos.sh
Created November 28, 2017 20:27
Ensures a certificate is in the macOS system keychain.
#!/bin/bash
# Usage
# $ ./install-cert-macos.sh "/path/to/cert"
CERT_PATH="$1"
# First, grab the SHA-1 from the provided SSL cert.
CERT_SHA1=$(openssl x509 -in "$CERT_PATH" -sha1 -noout -fingerprint | cut -d "=" -f2 | sed "s/://g")
# Next, grab the SHA-1s of any standard.dev certs in the keychain.
# Don't return an error code if nothing is found.
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@huacnlee
huacnlee / bootbox.rails.js
Last active November 13, 2018 11:37
Custom confirmation dialog in Rails
// Override jquery_ujs data-confirm
// use bootbox.confirm instead of window.confirm
// https://gist.github.com/huacnlee/84d13ea64cc8ccb2d4b0
$.rails.allowAction = function(element) {
var message = element.attr('data-confirm');
if (!message) { return true; }
var opts = {
title: "确认提交",
message: message,
@mimosa
mimosa / README.md
Last active January 11, 2017 07:49
Rails + JWT
  • 使用前:
    • �使用�前
  • 使用后:
    • 正确回传:
    • 使用后
    • 验证 (客户端)
    • 验证成功
    • 提交错误:
    • 验证错误