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
#!/bin/bash | |
find . -name '*.DS_Store' -type f -delete; | |
find . -name 'Thumbs.db' -type f -delete; | |
find . -name '*.swp' -type f -delete; | |
find . -name '*.AppleDouble' -exec rm -rf {} \; | |
find . -name ".AppleDouble" -print0 | xargs -0 rm -rf; | |
find . -name ".TemporaryItems" -print0 | xargs -0 rm -rf; | |
find . -name ".Trashes" -print0 | xargs -0 rm -rf; | |
find . -name ".afpdeleted*" -print0 | xargs -0 rm -rf; |
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
// Public domain - https://gist.github.com/nolanw/dff7cc5d5570b030d6ba385698348b7c | |
import Foundation | |
extension URLRequest { | |
/** | |
Configures the URL request for `multipart/form-data`. The request's `httpBody` is set, and a value is set for the HTTP header field `Content-Type`. | |
- Parameter parameters: The form data to set. |
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
import picamera | |
from time import sleep | |
import datetime as dt | |
camera = picamera.PiCamera(resolution=(1024, 640), framerate=15) | |
camera.start_preview() | |
sleep(2) | |
camera.annotate_background = picamera.Color('black') | |
camera.annotate_text = dt.datetime.now().strftime('%Y-%m-%d %H:%M:%S') |
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
<job id="TheShawshankHammer"> | |
<script language="JScript" id="env"> | |
var fso = new ActiveXObject("Scripting.FileSystemObject"); | |
var WshShell = WScript.CreateObject("WScript.Shell"); | |
var deskPath = WshShell.SpecialFolders("Desktop"); | |
var arg = WScript.Arguments; | |
var scriptPath = WScript.ScriptFullName.split('\\').slice(0, -1).join('\\') + '\\'; | |
</script> | |
<script language="JScript" id="scan"> |
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
# Exclude the Podspecs | |
Pods/* | |
Podfile.lock | |
# Exclude any PSD/AI source | |
#*.psd | |
#*.ai | |
# Exclude generated files | |
VersionX-revision.h |
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
tell application "System Preferences" | |
activate | |
end tell | |
tell application "System Events" | |
tell process "System Preferences" | |
activate | |
delay 1 | |
click menu item "Displays" of menu "View" of menu bar 1 | |
delay 1 |
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
#!/bin/bash | |
# 解析 xcodeproj 的 Ruby 库 - https://github.com/CocoaPods/Xcodeproj | |
gem install --no-ri 'xcodeproj' | |
# xcoderbuild 的 Ruby 封装 - https://github.com/rayh/xcoder | |
gem install --no-ri 'xcoder' | |
# Xcode 工程配置工具 - https://github.com/thoughtbot/liftoff | |
gem install --no-ri 'liftoff' |
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
#!/bin/bash | |
# According to https://developer.apple.com/library/ios/#qa/qa1686/_index.html | |
# Install ImageMagick with MacPort: sudo port install ImageMagick | |
convert $1 -resize 512x512 iTunesArtwork.png # Ad Hoc iTunes | |
convert $1 -resize 144x144 Icon-72@2x.png # Home screen for "The New iPad" | |
convert $1 -resize 114x114 Icon@2x.png # Home screen for Retina display iPhone/iPod | |
convert $1 -resize 72x72 Icon-72.png # App Store and Home screen on iPad | |
convert $1 -resize 58x58 Icon-Small@2x.png # Spotlight and Settings for Retina display | |
convert $1 -resize 57x57 Icon.png # Home screen on non-Retina iPhone/iPod | |
convert $1 -resize 50x50 Icon-Small-50.png # Spotlight on iPad 1/2 |
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
import Foundation | |
enum CollectionOperator: String { | |
case avg | |
case count | |
case max | |
case min | |
case sum |
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
import Cocoa | |
import CreateML | |
let 双色球神算子 = try MLTextClassifier(trainingData: [ | |
"中奖啦": [ | |
"09 11 14 20 27 30 09", | |
"02 09 14 15 16 23 10", | |
"11 16 19 22 25 30 08", | |
"02 05 06 13 16 19 03", | |
"04 09 15 16 19 27 10", |