๐ @dcai's gist index
- ๐ index.md
gist:907013gist index
- ๐ gitolite.sh
gist:1063097Setting up gitolite for archlinux
- ๐ cvs-moodle.bash
gist:1071173cvs helper for moodle repository
- ๐ daemon.py
- ๐ฆ cg, cgvg_parser.awk, vg
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 |
| #!/bin/bash | |
| # | |
| # Inspired by uzix's cgvg https://uzix.org/cgvg.html | |
| # | |
| # cg: code grep | |
| # vg: vim grepped | |
| # | |
| INDEX_FILE="$XDG_STATE_HOME/cgvg.index" | |
| export GRAY="\033[37m" |
| { | |
| "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 | |
| echo /opt/homebrew/bin/fish | sudo tee -a /etc/shells | |
| chsh -s /opt/homebrew/bin/fish | |
| echo "# must have casks" |
| 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); |