Skip to content

Instantly share code, notes, and snippets.

View niclin's full-sized avatar

Nic niclin

View GitHub Profile
@niclin
niclin / FiveStar.sol
Last active January 12, 2022 08:55
五星上將
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract FiveStarGeneral is ERC721Enumerable, Ownable {
#!/usr/bin/env bash
set -o errexit
green='\033[0;32m'
no_color='\033[0m'
ok() {
echo -e "$green$1$no_color"
}
@niclin
niclin / rails_convention.md
Last active March 22, 2019 17:39 — forked from xdite/gist:758319
Ruby / Rails Convention

Rails 開發注意要點

About Ruby Syntax

  • 編輯器設定 soft tab (space=2),以 2 格空白符號做為程式內縮距離(不分語言)。
  • 函式如果只有一個參數,就不強制打()
  • 函式如果有二個以上的參數,通通都要有 ()
    • (避免發生奇怪的paser bug跟保持專案一致性)
  • 字串限定用雙引號包覆
  • 善用 "#{str1} #{str3}" 等字串改寫技巧取代不需要的字串加法。
@niclin
niclin / tmux.conf
Created January 3, 2017 10:00 — forked from rajanand02/tmux.conf
Tmux configurations with status bar theme
# set prefix to control-f
set -g prefix C-f
#unbind system defined prefix
unbind C-b
# helps in faster key repetition
set -sg escape-time 0
# start session number from 1 rather than 0
@niclin
niclin / fix_git_sslread_9806.sh
Last active December 16, 2016 13:46
git: how to solve "SSLRead() return error -9806" in OSX using brew
brew remove git
brew remove curl
brew install openssl
brew install --with-openssl curl
brew install --with-brewed-curl --with-brewed-openssl git
@niclin
niclin / tmux_install.sh
Created December 12, 2016 09:57
Install tmux 2.3 on Ubuntu 14.04 from source
sudo apt-get update
sudo apt-get install -y libevent-dev libncurses-dev make
wget https://github.com/tmux/tmux/releases/download/2.3/tmux-2.3.tar.gz
tar xvzf tmux-2.3.tar.gz
cd tmux-2.3/
./configure && make
sudo make install