📇 @dcai's gist index
- 📜 index.md
gist:907013
gist index
- 📜 gitolite.sh
gist:1063097
Setting up gitolite for archlinux
- 📜 cvs-moodle.bash
gist:1071173
cvs helper for moodle repository
- 📜 daemon.py
- 📜 .gitolite.pl
gist:907013
gist indexgist:1063097
Setting up gitolite for archlinuxgist:1071173
cvs helper for moodle repository# First, get you id_rsa.pub onto the server as /tmp/YourName.pub | |
scp ~/ssh/id_rsa.pub [email protected]:/tmp/dongsheng.pub | |
# Then, as root: | |
cd $HOME | |
yaourt -S gitolite-git | |
su git |
ct (){ | |
if [ $# -eq 0 ]; then | |
echo "CVS TAG: No arguments entered."; | |
return 1 | |
else | |
echo "Tagging [MOODLE_$1_MERGED]"; | |
echo "File(s) ${@:2}"; | |
echo "Tagging ..."; | |
cvs tag -RF MOODLE_$1_MERGED ${@:2} |
#!/usr/bin/env python | |
import sys, os, time, atexit | |
from signal import SIGTERM | |
class Daemon: | |
""" | |
A generic daemon class. | |
Usage: subclass the Daemon class and override the run() method |
# paths and configuration variables for gitolite | |
$GL_PACKAGE_CONF="/etc/gitolite"; | |
$GL_PACKAGE_HOOKS="/usr/share/gitolite/hooks"; | |
# please read comments before editing | |
# this file is meant to be pulled into a perl program using "do" or "require". | |
# You do NOT need to know perl to edit the paths; it should be fairly |
{ | |
"spell_check": true, | |
"always_show_minimap_viewport": false, | |
"auto_find_in_selection": true, | |
"bold_folder_labels": false, | |
"caret_style": "wide", | |
"close_windows_when_empty": false, | |
"copy_with_empty_selection": false, | |
"create_window_at_startup": false, | |
"detect_indentation": true, |
find . -name '*.part01.rar' -exec unrar -y x {} \; |
# -i ".bak" will create backup files | |
find . -type f -name '*.[m|h]' -print0|xargs -0 sed -i "" -E "s/[[:space:]]*$//" |
#!/bin/bash | |
# essentials | |
/opt/homebrew/bin/brew install fish iterm2 | |
echo /opt/homebrew/bin/fish | sudo tee -a /etc/shells | |
chsh -s /opt/homebrew/bin/fish | |
# dev must have |
static UIImage *shrinkImage(UIImage *original, CGSize size) { | |
CGFloat scale = [UIScreen mainScreen].scale; | |
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); | |
CGContextRef context = CGBitmapContextCreate(NULL, size.width * scale, | |
size.height * scale, 8, 0, colorSpace, kCGImageAlphaPremultipliedFirst); | |
CGContextDrawImage(context, | |
CGRectMake(0, 0, size.width * scale, size.height * scale), | |
original.CGImage); | |
CGImageRef shrunken = CGBitmapContextCreateImage(context); |