次のようなコードを考える。
case class User(id: Int, name: String, mail: String)
class DB(host: String, port: Int) {| require 'formula' | |
| class Gdb < Formula | |
| url 'http://ftpmirror.gnu.org/gdb/gdb-7.4.tar.bz2' | |
| homepage 'http://www.gnu.org/software/gdb/' | |
| md5 '95a9a8305fed4d30a30a6dc28ff9d060' | |
| def install | |
| args = ["--prefix=#{prefix}", | |
| "--disable-debug", |
| % brew install mongodb | |
| ==> Downloading http://fastdl.mongodb.org/osx/mongodb-osx-x86_64-2.2.0.tgz | |
| ######################################################################## 100.0% | |
| ==> Caveats | |
| To have launchd start mongodb at login: | |
| ln -s /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents/ | |
| Then to load mongodb now: | |
| launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist | |
| Or, if you don't want/need launchctl, you can just run: | |
| mongod |
| #!/bin/sh | |
| export DEVELOPER_DIR=`xcode-select -print-path` | |
| "$DEVELOPER_DIR/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash" "$1" "$2" |
| <?php | |
| define('JENKINS_JOBS_DIRECTORY', '/path/to/your/jenkins/jobs'); | |
| define('JENKINS_ARCHIVE_SYMBOL_PATH_PATTERN', '/build/Release-iphoneos/*.app'); | |
| $JENKINS_JOBS = array(); // Your Jenkins jobs | |
| // -------- -------- -------- -------- -------- -------- -------- -------- -------- -------- | |
| if ($_SERVER['REQUEST_METHOD'] != 'POST') { | |
| echo '<html><body><form method="POST" enctype="multipart/form-data"><input type="file" name="crashlog"><input type="submit"></form></body></html>'; |
| #!/bin/zsh | |
| name=your-app-name | |
| for app in your-archives-directory-pattern/*.xcarchive/Products/Applications/$name.app; do | |
| if dwarfdump -u "$app/$name" | tr '[:upper:]' '[:lower:]' | tr -d '-' | grep "$1"; then | |
| echo $app | |
| exit | |
| fi | |
| done |
Swing Hacks の "Hack 84. Construct Single-Launch Applications" などで紹介されている方法です。
static final int LOCK_PORT = 38629;
ServerSocket serverSocket = null;
try {
serverSocket = new ServerSocket(LOCK_PORT);
// 多重起動ではなかった| (function(){ | |
| var total = 0; | |
| var year = '2012'; | |
| function init(num) { | |
| num = (typeof num !== 'number' ? 0 : num); | |
| if(num === 0) { | |
| $('<div/>').css({ | |
| position: 'fixed', | |
| left: 0, | |
| top: 0, |
| (defadvice ask-user-about-supersession-threat (around ask-user-about-supersession-threat-if-necessary) | |
| "Call ask-user-about-supersession-threat only if the buffer is actually obsolete." | |
| (if (or (buffer-modified-p) | |
| (verify-visited-file-modtime) | |
| (< (* 8 1024 1024) (buffer-size)) | |
| (/= 0 (call-process-region 1 (+ 1 (buffer-size)) "diff" nil nil nil "-q" (buffer-file-name) "-"))) | |
| ad-do-it | |
| (clear-visited-file-modtime) | |
| (not-modified))) | |
| (ad-activate 'ask-user-about-supersession-threat) |