Skip to content

Instantly share code, notes, and snippets.


Zhou Hao upbit

  • China
View GitHub Profile
ZipFile /
Last active Jan 25, 2023
Pixiv OAuth Flow

Retrieving Auth Token

  1. Run the command:

    python login

    This will open the browser with Pixiv login page.

ditzel / ScrollAndPinch.cs
Created Jul 22, 2019
Pinch and Scroll to Move and Zoom in Unity for Mobile Games
View ScrollAndPinch.cs
Set this on an empty game object positioned at (0,0,0) and attach your active camera.
The script only runs on mobile devices or the remote app.
using UnityEngine;
class ScrollAndPinch : MonoBehaviour
sajithneyo / bracket-pair-colorizer-2-settings
Created Jun 25, 2019
Settings you need for bracket pair colorizer 2
View bracket-pair-colorizer-2-settings
"bracket-pair-colorizer-2.colors": [
goraj /
Last active Oct 1, 2021
incremental learning lightgbm
# -*- coding: utf-8 -*-
@author: goraj
import lightgbm as lgbm
from sklearn.datasets import load_digits
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import roc_auc_score
W4ngatang /
Last active Nov 26, 2022
Script for downloading data of the GLUE benchmark (
''' Script for downloading all GLUE data.
Note: for legal reasons, we are unable to host MRPC.
You can either use the version hosted by the SentEval team, which is already tokenized,
or you can download the original data from ( and extract the data from it manually.
For Windows users, you can run the .msi file. For Mac and Linux users, consider an external library such as 'cabextract' (see below for an example).
You should then rename and place specific files in a folder (see below for an example).
mkdir MRPC
cabextract MSRParaphraseCorpus.msi -d MRPC
View homebridge
# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
HOMEBRIDGE_OPTS=-U /var/lib/homebridge
# If you uncomment the following line, homebridge will log more
# You can display this via systemd's journalctl: journalctl -f -u homebridge
ololobus /
Last active Nov 22, 2022
Apache Spark installation + ipython/jupyter notebook integration guide for macOS

Apache Spark installation + ipython/jupyter notebook integration guide for macOS

Tested with Apache Spark 2.1.0, Python 2.7.13 and Java 1.8.0_112

For older versions of Spark and ipython, please, see also previous version of text.

Install Java Development Kit

adamveld12 /
Last active Jan 17, 2023
Go Code Review Comments

Go Code Review Comments

This page collects common comments made during reviews of Go code, so that a single detailed explanation can be referred to by shorthands. This is a laundry list of common mistakes, not a style guide.

You can view this as a supplement to

Please discuss changes before editing this page, even minor ones. Many people have opinions and this is not the place for edit wars.

patrickhammond /
Last active Nov 13, 2022
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL"

thynson / k_from_n.js
Last active Aug 29, 2015
Get random k numbers from an iterator of arbitrary N length array where N is unknown. (pseudo code)
View k_from_n.js
function(iter, k) {
var array = [];
var count = 0;
for (var val = iter(); val !== undefined; val = iter()) {
count ++;
if (array.length < k)
else {
var luck = rand() % count;
if (luck < k) {