Skip to content

Instantly share code, notes, and snippets.

View syu-id's full-sized avatar

Shaoyun Yu syu-id

  • The Hong Kong Polytechnic University
  • Hong Kong SAR
View GitHub Profile
@liwh
liwh / gist:894109
Created March 30, 2011 09:13
reload functon for zsh completion
#when we create new function or install new bin , the default zsh cant get the new completion for us,so we
#can add a new function for this problem,you can add the blow content in your .zshrc file
function reload() {
if [[ "$#*" -eq 0 ]]; then
test -r /etc/zsh/zsh-oli && . /etc/zsh/zsh-oli
test -r ~/.zshrc && . ~/.zshrc
return 0
else
local fn
for fn in $*; do
@pullmonkey
pullmonkey / gist:1361596
Created November 13, 2011 04:28
hello android tutorial in mirah/pindah
package com.example.android.hello_world;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
class HelloWorld < Activity
def onCreate(state:Bundle)
super state
tv = TextView.new(self)
@amateurhuman
amateurhuman / gist:2005745
Created March 9, 2012 09:03
Installing Rubinius 2.0.0-dev with rbenv

Installing rbx-2.0.0-dev with Ruby 1.9 support using rbenv can be a tad tricky. This is what I did to get up and running, you'll need another version of ruby already installed as well as rake.

The basic outline:

  1. Clone Rubinius HEAD from github
  2. Configure installation for rbenv and 1.9 support
  3. Install Rubinius
  4. Configure your $PATH to use Rubinius gems
  5. Start using Rubinius
@damianavila
damianavila / remove_output.py
Created April 3, 2013 22:05
Remove output from IPython notebook from the command line (dev version 1.0)
"""
Usage: python remove_output.py notebook.ipynb [ > without_output.ipynb ]
Modified from remove_output by Minrk
"""
import sys
import io
import os
from IPython.nbformat.current import read, write
@AnthonyDiGirolamo
AnthonyDiGirolamo / userChrome.css
Last active June 4, 2023 19:40
thunderbird custom style for message and folder pane list
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* Set Font Size In Folder Pane */
#folderTree >treechildren::-moz-tree-cell-text {
/*font-family: Lucida Sans !important;*/
font-size: 12pt !important; }
/* Set Font Size In Thread Pane */
@casallas
casallas / multinomial.md
Last active January 14, 2023 22:12
R Packages/Functions/Resources for multinomial (ordinal & categorical) regression
Package Ordinal Multinomial Partial proportional odds Scale Effects Random Effects
nnet no multinom N/A N/A No
MASS polr No No No No
ordinal clm/clm2 all X's in nominal (may not converge) offending X's in nominal via scale clmm/clmm2
VGAM yes ? ? ? No
MCMCglmm yes ? ? ? ?
Mixcat yes ? ? npmlt
mlogit ? mlogit N/A N/
@hyang0
hyang0 / setZh4msysgit.sh
Last active January 4, 2016 04:59
msysgit 中文乱码解决方案
#!/bin/sh
# 中文编码支持
echo "export LESSCHARSET=utf-8" > $HOME/.profile
git config --global gui.encoding utf-8
git config --global i18n.commitencoding utf-8
git config --global i18n.logoutputencoding utf-8
git config --global core.quotepath false
# 别名设置
@lucascaton
lucascaton / Rails' time zones
Created December 3, 2014 05:18
$ rake time:zones:all
* UTC -11:00 *
American Samoa
International Date Line West
Midway Island
Samoa
* UTC -10:00 *
Hawaii
* UTC -09:00 *
@ctechols
ctechols / compinit.zsh
Last active June 15, 2024 19:43
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
@HaleTom
HaleTom / print256colours.sh
Last active June 18, 2024 02:37
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256