This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Finder" | |
set pic1 to POSIX file "/Users/evan/Pictures/fav/3988102622_aec9e25b9e_o.jpg" | |
set pic2 to POSIX file "/Users/evan/Pictures/fav/fruit-dealer-full.jpg" | |
tell application "System Events" | |
set theDesktops to a reference to every desktop | |
set picture of item 2 of the theDesktops to file pic2 | |
end tell | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#虾米电台不给力啊! 哥要导到豆瓣去咯 | |
#SETTING BEGAIN | |
uid='' #要抓的用户id, 比如我的就是11087 | |
maxPage="25" #一共要抓的页数 | |
i="0" #起始页数 | |
TMP="/tmp/xiami" #缓存目录 | |
FILE="./fav.txt" #最后保存文件 | |
#SETTING END |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Firefox" to activate | |
tell application "System Events" | |
if UI elements enabled then | |
keystroke "r" using command down | |
keystroke tab using command down | |
end if | |
end tell | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: set et sw=4 ts=4 sts=4 fdm=syntax ff=unix fenc=utf8: | |
#!/usr/bin/python | |
import json | |
from subprocess import Popen | |
import urllib2 | |
_url = 'http://douban.fm/j/mine/playlist?type=n&h=&channel=0' | |
req = urllib2.urlopen(urllib2.Request(_url)) | |
obj = json.load(req) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# vim: set et sw=4 ts=4 sts=4 fdm=syntax ff=unix fenc=utf8: | |
''' | |
set/get wallpaper from simpledesktops.com on mac OS | |
require appscript module, sudo easy_install appscript | |
''' | |
import urllib2, re, os | |
from appscript import * | |
path = './wallpaper/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="xhrproxy.js"></script> | |
<script> | |
setupXHRProxy(); | |
</script> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name markdown for v2ex content | |
// @namespace http://www.v2ex.com/ | |
// @include http://www.v2ex.com/t/* | |
// ==/UserScript== | |
/* | |
* About = { | |
* source: 'http://webreflection.blogspot.com/2012/02/js1k-markdown.html', | |
* preview: 'http://www.v2ex.com/t/28444', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
resolver 8.8.8.8; | |
access_log off; | |
listen 80 default_server; | |
listen 443 ssl; | |
ssl_certificate /usr/local/nginx/conf/ssl/server.crt; | |
ssl_certificate_key /usr/local/nginx/conf/ssl/server.key; | |
location / { | |
proxy_pass $scheme://$host$request_uri; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
# -*- coding: utf-8 -*- | |
import os | |
import requests | |
from BeautifulSoup import BeautifulSoup as Soup | |
limit = 5 # max = 20 | |
feed_url = 'http://feeds.feedburner.com/python-china?format=xml' | |
req = requests.get(feed_url).text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Chromium update script | |
# Mac | Linux | ... | |
OS=Mac | |
BASE_URL=http://commondatastorage.googleapis.com/chromium-browser-snapshots/${OS} | |
LATEST_URL=${BASE_URL}/LAST_CHANGE | |
LATEST=$(curl ${LATEST_URL}) | |
_OS=$(tr '[A-Z]' '[a-z]'<<<${OS}) | |
APP_URL=${BASE_URL}/${LATEST}/chrome-${_OS}.zip |
OlderNewer