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
function getCommands() | |
{ | |
$argv = $GLOBALS['argv']; | |
$tmp = []; | |
foreach ($argv as $key => $item) { | |
$name = $item; | |
$value = ''; | |
if (strpos($name, '=') !== false) { | |
list($name) = explode('=', $item); | |
$value = ltrim(strstr($item, "="), "="); |
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
<?php | |
$lock_key = 'LOCK_PREFIX_'. $key; | |
$is_lock = $redis->setNX($lock_key, 1); // 加锁 | |
if ($is_lock == true) {// 获取锁权限 | |
// ... 具体操作 | |
// 释放锁 | |
$redis->del($lock_key); | |
return true; |
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 | |
# Author: Matt Mastracci (matthew@mastracci.com) | |
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script | |
# licensed under cc-wiki with attribution required | |
# Remainder of script public domain | |
osascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm | |
if [[ $NAME = "iTerm" ]]; then | |
FILE=`osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose file with prompt "Choose a file to send"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"` | |
else |
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 | |
# Author: Matt Mastracci (matthew@mastracci.com) | |
# AppleScript from http://stackoverflow.com/questions/4309087/cancel-button-on-osascript-in-a-bash-script | |
# licensed under cc-wiki with attribution required | |
# Remainder of script public domain | |
osascript -e 'tell application "iTerm2" to version' > /dev/null 2>&1 && NAME=iTerm2 || NAME=iTerm | |
if [[ $NAME = "iTerm" ]]; then | |
FILE=`osascript -e 'tell application "iTerm" to activate' -e 'tell application "iTerm" to set thefile to choose folder with prompt "Choose a folder to place received files in"' -e "do shell script (\"echo \"&(quoted form of POSIX path of thefile as Unicode text)&\"\")"` | |
else |