Skip to content

Instantly share code, notes, and snippets.

View twlz0ne's full-sized avatar

twlz0ne

  • Fuzhou, China
View GitHub Profile
@twlz0ne
twlz0ne / rotate-screen-90-degrees.applescript
Last active August 22, 2023 12:42
Rotate Display using AppleScript for MacOSX 10.6.8
tell application "System Preferences"
quit
delay 1
launch
activate
tell application "System Events"
key down {option, command}
end tell
reveal pane id "com.apple.preference.displays"
tell application "System Events"
@twlz0ne
twlz0ne / id3dump.py
Created April 11, 2013 11:43
dump id3 tag info to .json file
#!/usr/bin/env python2
# @brief dump id3 tag info to .json file
# @version 0.1
# @author gongqijian
# @create 2013/04/11
import os
import sys
import getopt
@twlz0ne
twlz0ne / kcpassword.pl
Last active February 20, 2016 02:51
Securely auto login Mac OS X ## Usage: curl -O https://raw.github.com/gist/5479944/safe-autologin.sh && sh ./safe-autologin.sh
#!/usr/bin/perl
# Gavin Brock (http://brock-family.org/gavin/perl) - June 2007
#==============================================================================#
use strict;
use warnings;
use Foundation;
#==============================================================================#
@twlz0ne
twlz0ne / script2bundle.sh
Created May 8, 2013 17:02
Convert apple/shell script to bundle
#!/bin/bash
# @brief convert apple/shell script to bundle
# @version 0.1
# @auther gongqijian
# @date 2013/05/09
set -e
if [ $# -lt 1 ]; then
@twlz0ne
twlz0ne / howto-keeping-a-feature-branch-update-with-upstream.md
Created October 10, 2013 01:57
git feature branch 如何跟踪上游变化?

基于上游仓库某次提交做了修改

----(a)---------------> upstream/up_master
      \
------(b)-------------> origin/my_master

一段时间之后,上游仓库更新了

----(a)--(c)--(d)--(e)--(f)--(g)--> upstream/up_master
@twlz0ne
twlz0ne / runemacs.applescript
Created October 18, 2013 06:57
Emacs(emacsformacosx) startup script
-- @brief emacs startup script
-- @author gongqijian
-- @date 2013/04/28
--
-- Usage:
--
-- 把 applescript 转换成 bundle,跟配置文件 _emacs.d 放在同一个目录下:
-- .
-- |- runemacs.app
-- |- _emacs.d
@twlz0ne
twlz0ne / group.js
Last active December 27, 2015 07:19
福州豆瓣租房团小组书签
var group = new (function() {
var foo = function() {
var recruit = new Array(); //招租
var recruit_roommate = new Array(); //招合租
var wanted = new Array(); //求租
var wanted_roomate = new Array(); //求合租
var others = new Array(); //其他
for (var i = 0; i < 5; i++) {
$.ajax({type : 'get',
ParentCtrl = function($scope) {
$scope.validate = function() {
//...
}
$scope.edit = function(item) {
//...
$scope.validate();
//...
}

豆瓣爬山群 2013 年年会

时间:29号晚6:30(请务必准时到达)

地点:金鸡山瑞和楼

主题:交换礼物信件,吃喝聊天,总结过去,展望未来

费用:预收¥100/人(吃喝以及场地费用,不包含礼物),多还少补