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 | |
INPUT_FILE="clock.flv"; | |
if [ ! -f "$INPUT_FILE" ]; then | |
echo "clock.flv not found, start downloading...\n" | |
curl -o "clock.flv" "http://ykgroup.qiniudn.com/clock4.flv" | |
fi | |
#TELECOM |
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
require 'openssl' | |
require 'base64' | |
require 'uri' | |
def base64_url_encode(str) | |
Base64.encode64(str).tr("+/", "-_").gsub(/[\n\r]?/, "") | |
end | |
def digest(secret, bytes) | |
OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha1'), secret, bytes) |
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
String key = IO.UNDEFINED_KEY; // 自动生成key, 也可指定key名 | |
PutExtra extra = new PutExtra(); | |
extra.checkCrc = PutExtra.AUTO_CRC32; // 可选, 上传校验crc32值 | |
extra.params.put("x:arg", "val"); // 可选, 自定义参数, callback时可传递给AppServer | |
IO.putFile(this, uploadToken, key, uri, extra, new JSONObjectRet() { | |
@Override | |
public void onSuccess(JSONObject resp) { | |
// ... | |
} |
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
conf.ACCESS_KEY = "YOUR_APP_ACCESS_KEY" | |
conf.SECRET_KEY = "YOUR_APP_SECRET_KEY" | |
putPolicy := rs.PutPolicy { | |
Scope, // 必须, 目标存储空间 | |
ReturnUrl, // 可选, 指定上传成功后301跳转URL | |
ReturnBody, // 可选, 自定义客户端ResponseBody, 可用魔法变量求值 | |
CallbackUrl, // 可选, 指定通知回调URL | |
CallbackBody, // 可选, 指定通知回调ResquestBody, 可使用魔法变量求值 | |
PersistentOps, // 可选, 音视频等大文件上传异步预转指令集合 |
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 | |
# 此脚本可监控 Linux/Unix 上指定的文件夹,并将此文件夹内的新增或改动文件自动同步到七牛云存储,可设定同步删除。 | |
# 1. 需先安装 inotify-tools - <https://github.com/rvoicilas/inotify-tools/wiki> | |
# 2. 然后下载 qboxrsctl - <http://docs.qiniutek.com/v3/tools/qboxrsctl/> | |
# 获取 ACCESS_KEY 和 SECRET_KEY 以及 BUCKET_NAME (空间名称) 请登录:<https://dev.qiniutek.com> | |
# 用法(反斜杠用于排版换行需要,实际情况下可忽略): |
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
function isEqual(a,b) | |
{ | |
var c = typeof(a); | |
var d = typeof(b); | |
if (c != d) return false; | |
if (c != "object") return a == b; | |
var m = 0, n = 0; | |
for (var e in a) | |
{ | |
m += 1; |
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
why404@404-ubuntu:~/code$ cat BoardTest.java | |
// Source Code for BoardTest.java | |
public class BoardTest | |
{ | |
public static void main(String args[]) | |
{ | |
char[][] pic = new char[8][8]; | |
for (int i = 0; i < 8; i++) |
NewerOlder