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 () { | |
$('#file-').fileupload({ | |
dataType: 'json', | |
type: 'PATCH', | |
acceptFileTypes: /(\.|\/)(mp4)$/i, | |
minFileSize: 1000000, | |
url:"/micro/events/#{@event.id}/episodes/#{@episode.id}/upload", | |
progressall: function (e, data) { | |
var progress = parseInt(data.loaded / data.total * 90, 10); |
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 java.security.MessageDigest; | |
public class CheckSumBuilder { | |
// 计算并获取CheckSum | |
public static String getCheckSum(String appSecret, String nonce, String curTime) { | |
return encode("sha1", appSecret + nonce + curTime); | |
} | |
// 计算并获取md5值 | |
public static String getMD5(String requestBody) { |
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
# using libfaac on Mac OS X 10.6.8 | |
# -vn : not copying video | |
# -acodec : specify codec used in flv file | |
# -ac : channels. 1 is for mono, 2 is for stereo | |
# -ab : specify bitrate for output file (note that rate is not kbps but bps) | |
# -ar : sampling frequency (Hz) | |
# -threads: number of threads for encoding | |
# "-strict experimental" is necessary to use libfaac | |
ffmpeg -y -i xxxxxxxxxxx.flv -vn -acodec aac -ac 2 -ab 128000 -ar 44100 -threads 4 -strict experimental xxxxx.m4a |
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
GRANT ALL PRIVILEGES ON *.* TO marty@'%' IDENTIFIED BY 'watch4keys' WITH GRANT OPTION; |
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
console.log("Start", new Date().getTime()); | |
var fs = require('fs'); | |
for (var i = 1; i < 10; i++) { | |
fs.readFile("test.mp4",function(err, data) { | |
if(err) | |
console.log("read error: ", err); | |
else { | |
fs.writeFile(__dirname + "/new.mp4", data , function(err) { | |
if(err) { | |
console.log("write error: ", err); |
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
If this is your first install, automatically load on login with: | |
cp /usr/local/Cellar/mongodb/1.6.3-x86_64/org.mongodb.mongod.plist ~/Library/LaunchAgents | |
launchctl load -w ~/Library/LaunchAgents/org.mongodb.mongod.plist | |
If this is an upgrade and you already have the org.mongodb.mongod.plist loaded: | |
launchctl unload -w ~/Library/LaunchAgents/org.mongodb.mongod.plist | |
cp /usr/local/Cellar/mongodb/1.6.3-x86_64/org.mongodb.mongod.plist ~/Library/LaunchAgents | |
launchctl load -w ~/Library/LaunchAgents/org.mongodb.mongod.plist | |
Or start it manually: |
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
http://uthash.sourceforge.net/ | |
http://www.monkey.org/~provos/libevent/ |
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
gem install addressable -v2.1.0 | |
gem install merb-core -v1.0.12 --no-rdoc --no-ri | |
gem install merb-auth-core -v=1.0.12 --no-rdoc --no-ri | |
gem install merb-auth-more -v=1.0.12 --no-rdoc --no-ri | |
gem install merb-slices -v1.0.12 --no-rdoc --no-ri |
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
`gem list|egrep ^merb`.split.select{|x|x !~ /[()]/}.each{|gem| system "gem uninstall #{gem}"} | |
`gem list|egrep ^dm-`.split.select{|x|x !~ /[()]/}.each{|gem| system "gem uninstall #{gem}"} |