IMG convert to TAR

  1. 使用tar打包
  2. 使用md5sum 加入md5

刷了CWM再刷回原廠Recovery - Android 台灣中文網 - Android(安卓,安致)討論區 - Powered by Discuz! How to Convert .img Recovery to .tar.md5 Flashable File (Windwos) - W0lfDroid [Tool][[windows] Make CWM Recovery .img's into .tar.md5 odin flash-able files 1 CLICK - xda-developers

SQL Paging

ROW_NUMBER Function (MS SQL 2005+)
DECLARE @rowsPerPage int,
@startNum int,
@endNum int,
@pageIndex int
SET @pageIndex = 1
SET @rowsPerPage = 10
SET @startNum = @rowsPerPage * @pageIndex
SET @endNum = @startNum + @rowsPerPage
SELECT * FROM (
SELECT ROW_NUMBER() OVER (ORDER BY AccountID) 'RowNum',AccountID,FullName
FROM Member
) AS NewTable
WHERE RowNum >= @startNum AND RowNum <= @endNum
view raw gistfile1.sql hosted with ❤ by GitHub
Temp Table
CREATE PROCEDURE [dbo].[SP_CUST_SQL_Paging]
@pageIndex int
AS
BEGIN
DECLARE @rowsPerPage int,
@startNum int,
@endNum int
SET @rowsPerPage = 10
SET @startNum = @rowsPerPage * @pageIndex
SET @endNum = @startNum + @rowsPerPage
IF OBJECT_ID('tempdb..#tmpTable') IS NOT NULL
DROP TABLE #tmpTable
CREATE TABLE #tmpTable (
[ROWNUM] int IDENTITY(1,1),
[id] [text] NULL,
[name] [varchar](50) NULL,
)
INSERT INTO #tmpTable ([id],[name])
SELECT *
FROM [Members]
ORDER BY postdate DESC
--SELECT COUNT(ROWNUM) 'TotalCount' FROM #tmpTable
SELECT id,name
FROM #tmpTable
WHERE ROWNUM > @startNum AND ROWNUM <= @endNum
DROP TABLE #tmpTable
END
GO
view raw gistfile1.sql hosted with ❤ by GitHub

Sublime Text Packages

  • BracketHighlighter
  • Emmet
  • EncodingHelper
  • IMESupport
  • jQuery
  • JsFormat
  • Package Control
  • Theme - Flatland
  • Theme - Soda
  • Theme - Spacegray
  • Tomorrow Color Schemes

String.prototype.smartShort()

String.prototype.smartShort = function(len) {
var smartStr = [];
var count = 0;
for (var i = 0; i < this.length; i++) {
if (count > len) {
smartStr.push('...');
break;
} else if (count === len) {
smartStr.push('....');
break;
}
if (/[^\x00-\xff]/.test(this.charAt(i))) {
count = count + 2;
} else {
count = count + 1;
}
smartStr.push(this.charAt(i));
};
return smartStr.join('');
}
console.log('Audi New A3 Sportback 1.8 TFSI'.smartShort(10));
console.log('獨領前衛風潮 掀背再出擊'.smartShort(10));
console.log('1996年的奧迪A3車系'.smartShort(10));
//Audi New A....
//獨領前衛風....
//1996年的奧....
view raw gistfile1.js hosted with ❤ by GitHub