Skip to content

Instantly share code, notes, and snippets.

View ychin's full-sized avatar

Yee Cheng Chin ychin

View GitHub Profile
@ychin
ychin / ev804_instructions.md
Last active June 2, 2023 04:46
Home fish feeder (Evnice EV804) instructions
@ychin
ychin / remove-contextmenu-event-handler.js
Last active July 3, 2023 02:54
Bookmarklet – Remove the anti-user event handlers on a website. If you are a web developer reading this: *Please* stop hijacking my web browser events, thanks!
javascript:window.addEventListener('contextmenu', function(event) {event.stopImmediatePropagation();}, true);
@ychin
ychin / go-up-bookmarklet.js
Last active August 21, 2020 01:21
Bookmarklet – Go up one directory in URL path
javascript:(function(num) {
/*
* Goes up one or more directory in path or remove path hash or query.
* To use this, condense into oneline then, paste the string into a
* bookmark in a web browser.
* Replace the "1" at the end of the script to change how many levels to go up.
*/
var newUrl = new URL(window.location);
for (var i = 0; i < num; i++) {
@ychin
ychin / findParentBranch.cmd
Last active January 16, 2022 17:36
Powershell scripts to find the "parent" branch (aka the branch with the closest parent commit) to the current one.
@powershell -NoProfile -File %~dp0findParentBranch.ps1 %*
@ychin
ychin / bitcoin-unlimited-full-node
Last active March 18, 2017 05:42
Basic script to set up a Bitcoin Unlimited full node on an Ubuntu cloud server
# Instructions:
# 1) Set up a VM or server running Ubuntu, and make sure port 8333 is open
# 2) Run this script in a bash environment.
# More complete steps at https://gist.github.com/romanz/17ff716f13a34df49ff4
# Basic installations
sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:bitcoin-unlimited/bu-ppa -y
sudo apt-get update -y
@ychin
ychin / Node.js EC2 setup
Last active August 29, 2015 14:18
Initialize and set up a new Amazon EC2 instance to have Node.js installed and ready to go
# Run this in a bash environment in an Amazon Linux instance
sudo yum -y update
sudo yum install gcc-c++ make
sudo yum install openssl-devel
sudo yum install git
mkdir libs
pushd libs
git clone https://github.com/joyent/node.git
git clone https://github.com/npm/npm.git
#!/bin/bash
# Original steps from: http://www.yzhang.net/blog/2013-03-07-pptp-vpn-ec2.html
#
# Run this in a root bash environment. This assumes a setting similar to Amazon EC2 Linux.
# Otherwise replace the lines that start with "yum" with whatever package manager is used.
# The script will ask for username and password, but if you want to do this programmatically,
# you can set environment variables $vpn_username and $vpn_password, then run with --no-prompt.
#
# After this is all set you should be able to connect to your new machine using VPN. Make