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 | |
/** | |
目的:分流歌詞成同步歌詞與非同步歌詞。 | |
step1 將文件內容轉換為UTF-8編碼 | |
step2 針對文件內容每一行,判斷是否存在timecode,若有則為同步歌詞,反之為非同步 | |
step3 若unsync長度少於十行,應從sync中過濾出非同步歌詞 | |
step4 儲存 | |
*/ | |
require_once("encoding.php"); |
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
/*** | |
code from http://qiujiayu.iteye.com/blog/565929 | |
*/ | |
<?php | |
define ('UTF32_BIG_ENDIAN_BOM' , chr(0x00) . chr(0x00) . chr(0xFE) . chr(0xFF)); | |
define ('UTF32_LITTLE_ENDIAN_BOM', chr(0xFF) . chr(0xFE) . chr(0x00) . chr(0x00)); | |
define ('UTF16_BIG_ENDIAN_BOM' , chr(0xFE) . chr(0xFF)); | |
define ('UTF16_LITTLE_ENDIAN_BOM', chr(0xFF) . chr(0xFE)); |
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
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> | |
<script src="http://more.handlino.com/javascripts/moretext-1.1.js" type="text/javascript"></script> | |
<style> | |
#text1 { | |
-webkit-column-width: 200px; | |
-webkit-column-gap: 20px; | |
-webkit-column-rule: 3px solid #eee; |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'http_request' | |
require 'builder' | |
class Net::HTTP | |
alias_method :old_initialize, :initialize | |
def initialize(*args) | |
old_initialize(*args) | |
@ssl_context = OpenSSL::SSL::SSLContext.new |
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
//The code is from http://www.mcgarvie.net/2009/07/17/programming/php/php-generatecreate-strong-passwords-uuid-random-string made by Brian M McGarvie/ | |
/** | |
Perfect for: PASSWORD GENERATION | |
Options: variable length | |
generateRandStr(8) | |
result: 4sRBfahW | |
**/ | |
<?php |
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
trac-admin /path_to_repo/project | |
#list help | |
Trac[/path_to_repo/project]> ? | |
#list current permission | |
Trac[/path_to_repo/project]> permission list | |
User Action | |
-------------------------- | |
anonymous BROWSER_VIEW |
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
#installation | |
gem install magic | |
#example | |
require "magic" | |
Magic.guess_file_mime("CKMetrics.pdf") | |
#=> "application/pdf; charset=binary" |
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
<? | |
$dir = new RecursiveIteratorIterator( | |
new RecursiveDirectoryIterator('/tmp'), true); | |
foreach ( $dir as $file ) { | |
echo str_repeat("--", $dir->getDepth()) . " $file\n"; | |
} | |
?> |
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
alias rscp='rsync -v -P -e ssh' |