Skip to content

Instantly share code, notes, and snippets.

View jimchan3301's full-sized avatar
🎯
Focusing

Jim Chan jimchan3301

🎯
Focusing
View GitHub Profile
@jimchan3301
jimchan3301 / ColorConverter.cs
Created April 16, 2024 10:11
Directly convert between Unity's Color32 and int.
/*
* Author: Jim Chan
* Created Date: 15/04/2024
*/
using System;
using UnityEngine;
public static class ColorConverter
{
public static Color32 ToColor(int value)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.Cecil.Rocks;
using Mono.Cecil.Pdb;
using System.IO;
curl https://raw.githubusercontent.com/teddysun/across/master/bbr.sh > bbr.sh
chmod +x bbr.sh
./bbr.sh
@jimchan3301
jimchan3301 / install-docker.sh
Last active May 26, 2017 02:38
Install docker on Ubuntu16.04
sudo apt-get -y install apt-transport-https ca-certificates curl
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get -y install docker-ce
# Generate your identity key on openwrt
dropbearkey -t rsa -f ~/.ssh/id_rsa
# Convert public key from dropbear binary to openssh text
# Copy and paste output from below to bitbucket account ssh keys
dropbearkey -y -f ~/.ssh/id_rsa | head -n 2 | tail -1
# Change git ssh command
echo "#!/bin/sh" > ~/.gitssh.sh
echo "dbclient -y -i ~/.ssh/id_rsa \$\*" >> ~/.gitssh.sh
chmod +x ~/.gitssh.sh
require('shelljs/global')
var svn = require('node-svn-ultimate')
var program = require('commander')
program
.version('0.0.1')
.option('-u, --url <url>', 'SVN url <url>')
.option('-d, --dir <dir>', 'Root dir <dir>')
.option('-r, --relative', 'Use relative path')
.option('-n, --username <username>', 'User name <username>')
@jimchan3301
jimchan3301 / svn-info.jison
Created April 2, 2016 21:09
Parse svn info text into js object.
%{
var table = {}
%}
%lex
%%
\n return 'NEWLINE'
": " return 'SEP'
[\w ]+ return 'WORDS'