Skip to content

Instantly share code, notes, and snippets.

View 0xffan's full-sized avatar
🔨
building...

X.F. 0xffan

🔨
building...
  • Chengdu, China
View GitHub Profile
@0xffan
0xffan / gist:c38571948e05dba46d4b239aa8b83ef2
Last active November 12, 2016 14:17 — forked from jagregory/gist:710671
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked;
however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
@0xffan
0xffan / Dorm-network.scpt
Last active September 2, 2015 15:21 — forked from Jeff2Ma/Dorm-network.scpt
Automatic proxy configuration set pac file with applescript & shell script http://devework.com/automatic-proxy-configuration-pac-applescript.html
tell application "System Events"
tell network preferences
do shell script "scselect 'Dorm'"
do shell script "sudo networksetup -setairportpower AirPort on" user name "用户名" password "密码" with administrator privileges
do shell script "open /Applications/Shad**socksX.app" user name “用户名" password "密码" with administrator privileges
end tell
end tell
@0xffan
0xffan / basic.html
Last active August 29, 2015 14:13 — forked from tobiastom/basic.html
<!DOCTYPE html>
<script type="text/javascript">
if ( window.name == 'popup' ) {
document.body.className += ' in-popup'
}
function selectItemInPopup(item) {
window.opener.popupDidSelectItem(window.item);
window.close();
}
popupWins = new Array();
function windowOpener(url, name, args) {
/*******************************
the popupWins array stores an object reference for
each separate window that is called, based upon
the name attribute that is supplied as an argument
*******************************/
if ( typeof( popupWins[name] ) != "object" ){
popupWins[name] = window.open(url,name,args);
#!/bin/bash
#script extraido de: http://paulocassiano.wordpress.com/2008/08/29/deixando-o-gedit-com-a-cara-do-textmate/
#tip for better "resolution" here: http://blog.siverti.com.br/2008/05/22/fonte-monaco-no-ubuntugedit/
cd /usr/share/fonts/truetype/
#TODO: put validation if folder already exists
sudo mkdir ttf-monaco