Skip to content

Instantly share code, notes, and snippets.

View Sitrone's full-sized avatar
🎯
Focusing

codergooze Sitrone

🎯
Focusing
  • China
View GitHub Profile
package binary
// 注意:数据量太小不适合二分查找,数据量太大也不适合二分查找。
// 二分查找,基本场景,查找等于给定值的元素
// 变体一:查找第一个值等于给定值的元素
// 变体二:查找最后一个值等于给定值的元素
// 变体三:查找第一个大于等于给定值的元素
// 变体四:查找最后一个小于等于给定值的元素
package id_str
import "math"
// 按照进制的思路,进行id <-> string 的相互转换
const (
defaultAlphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
defaultLen = 6
)
package main
import (
"database/sql"
"strconv"
"log"
"net/http"
"fmt"
"bytes"
"gopkg.in/gin-gonic/gin.v1"
@Sitrone
Sitrone / MySQL_macOS_Sierra.md
Created February 10, 2018 09:20 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@Sitrone
Sitrone / Jack-Hack VM.py
Created April 23, 2017 11:24 — forked from jweissbock/Jack-Hack VM.py
the VM to turn Jack VM into Hack ASM
import glob
# declare types of commands
C_ARITMETIC = object()
C_PUSH = object()
C_POP = object()
C_LABEL = object()
C_GOTO = object()
C_IF = object()
C_FUNCTION = object()
@Sitrone
Sitrone / 0_reuse_code.js
Created September 3, 2016 13:39
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