Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
This file contains 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 python2 | |
# coding: utf-8 | |
import os,socket,threading,time | |
#import traceback | |
allow_delete = False | |
local_ip = socket.gethostbyname(socket.gethostname()) | |
local_port = 8888 | |
currdir=os.path.abspath('.') |
This file contains 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
# luna_pinyin.custom.yaml | |
# | |
# 【朙月拼音】模糊音定製模板 | |
# 佛振配製 :-) | |
# | |
# 位置: | |
# ~/.config/ibus/rime (Linux) | |
# ~/Library/Rime (Mac OS) | |
# %APPDATA%\Rime (Windows) | |
# |
This file contains 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
# default.custom.yaml | |
# 全局範圍識別輸入串爲 rime + 任意數字序列,以及形如 rimeime-1.2.3 的常用西文短語 | |
# 也可將本組 patch 寫入 <輸入方案ID>.custom.yaml 使這組規則僅在一款輸入方案中有效 | |
# | |
# 第一例,輸入 rime 之後,再輸入任意一個數字,則立即識別爲西文輸入 | |
# 再加上 default.yaml 原有的 email 規則,識別包含 @ 字符的郵箱,於是可以一氣呵成 rime123@company.com | |
# 第二例,輸入到 rimeime 時,立即識別爲西文輸入,並可跟隨任意位數字及指定的符號 | |
patch: | |
recognizer/patterns/rime123: "^rime[0-9]+$" |
This file contains 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
# luna_pinyin.custom.yaml | |
# | |
# 在【朙月拼音】裏使用Emoji表情(這份配置已過時,新的emoji實現代碼在 https://github.com/rime/rime-emoji ) | |
# | |
# 保存到Rime用戶文件夾後,重新部署生效 | |
# ~/.config/ibus/rime (linux) | |
# ~/Library/Rime (macos) | |
# %APPDATA%\Rime (windows) | |
# | |
# 如果目標文件已經包含其他修改內容,只需按照縮進合併 patch: 以下的部分 |
This file contains 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
# 用移動硬盤同步RIME用戶詞典的樣例 | |
# 用於同步的分區名爲share(盤符H:),同步文件夾是 home/rimesync,Linux 用戶名爲 lotem | |
# 每套輸入法分別在 installation.yaml 裏設 sync_dir 和 installation_id | |
# 接上硬盤,Windows 和 Mac 一鍵完成同步。Linux 用 rime_dict_manager -s 同步。 | |
➜ ~ for x in /media/share/home/rimesync/*/installation.yaml ~/.config/ibus/rime/installation.yaml; do echo $x; echo '---'; cat $x; echo '...'; done | |
/media/share/home/rimesync/lotem-macbook/installation.yaml | |
--- | |
distribution_code_name: Squirrel | |
distribution_name: "鼠须管" |
This file contains 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
- (IBAction)downloadFile:(id)sender { | |
NSURL *url = [NSURL URLWithString:@"http://www.hulkshare.com/dl/qw30o7x373a8/stan_courtois_&_felly_vs_cutting_crew_-_die_in_your_arms_(x-centrik_mix)_%5B_www.themusix.net_%5D.mp3"]; | |
NSURLRequest *request = [NSURLRequest requestWithURL:url]; | |
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; | |
NSString *fullPath = [NSTemporaryDirectory() stringByAppendingPathComponent:[url lastPathComponent]]; | |
[operation setOutputStream:[NSOutputStream outputStreamToFileAtPath:fullPath append:NO]]; |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Brandon B. brandon@brandonbrown.io
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
This file contains 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/ruby | |
# encoding: utf-8 | |
# | |
# Updated 2017-10-25: | |
# - Defaults to large size (512) | |
# - If ImageMagick is installed: | |
# - rounds the corners (copped from @bradjasper, https://github.com/bradjasper/Download-iTunes-Icon/blob/master/itunesicon.rb) | |
# - replace original with rounded version, converting to png if necessary | |
# | |
# Retrieve an iOS app icon at the highest available resolution |
This file contains 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
# -*- coding: utf-8 -*- | |
from bs4 import BeautifulSoup | |
import requests | |
username = '' ###账号### | |
password = '' ###密码### | |
login_url = 'http://v2ex.com/signin' ###如V2EX设置了使用 SSL,必须改 https### | |
index_url = 'http://v2ex.com' ###同上### | |
mission_url = 'http://www.v2ex.com/mission/daily' ###同上### | |
UA = "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) \ |
OlderNewer