Skip to content

Instantly share code, notes, and snippets.

View lelinhtinh's full-sized avatar
🤤
Slimming failure

Thành Thân Thiện lelinhtinh

🤤
Slimming failure
  • Da nang, Vietnam
  • 07:11 (UTC +07:00)
View GitHub Profile
@lelinhtinh
lelinhtinh / jszip.min.js
Created May 25, 2015 15:49
A Javascript class for generating and reading zip files
/*!
JSZip - A Javascript class for generating and reading zip files
<http://stuartk.com/jszip>
(c) 2009-2014 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/master/LICENSE
@lelinhtinh
lelinhtinh / jszip-utils.min.js
Created May 25, 2015 15:47
A collection of cross-browser utilities to go along with JSZip
/*!
JSZipUtils - A collection of cross-browser utilities to go along with JSZip.
<http://stuk.github.io/jszip-utils>
(c) 2014 Stuart Knightley, David Duponchel
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown.
*/
!function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.JSZipUtils=a():"undefined"!=typeof global?global.JSZipUtils=a():"undefined"!=typeof self&&(self.JSZipUtils=a())}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b){"use strict";function c(){try{return new window.XMLH
@lelinhtinh
lelinhtinh / ForumotionBackupTemplates.user.js
Last active August 29, 2015 14:21
Userscript help you backup templates for your forumotion
// ==UserScript==
// @name Forumotion backup templates
// @namespace http://devs.forumvi.com/
// @version 2.0.1
// @description Export & Import forumotion Templates
// @copyright 2014+, Zzbaivong
// @icon http://i19.servimg.com/u/f19/18/83/32/63/icon-610.png
// @match http://*/admin/index.forum?mode=export*
// @match http://*/admin/index.forum?*&mode=export*
// @resource jszip https://gist.githubusercontent.com/baivong/a1af02ab10dcc6e1747b/raw/a09f35b86352b83e75013d495045032668ef342d/jszip.min.js
@lelinhtinh
lelinhtinh / Open options page of Chrome extension
Created May 21, 2015 21:46
Mở trang tùy chọn của Chrome extension
var optionsUrl = chrome.extension.getURL("options.html");
chrome.tabs.query({
url: optionsUrl
}, function (tabs) {
if (tabs.length) {
chrome.tabs.update(tabs[0].id, {
active: true
});
} else {
@lelinhtinh
lelinhtinh / Open settings page of addon Firefox
Created May 21, 2015 21:38
Mở trang tùy chọn của addon Firefox
// http://stackoverflow.com/a/22601737/4926686
var self = require('sdk/self'),
tabs = require('sdk/tabs');
tabs.open({
url: 'about:addons',
onReady: function (tab) {
tab.attach({
contentScriptWhen: 'end',
contentScript: 'AddonManager.getAddonByID("' + self.id + '", function(aAddon) {unsafeWindow.gViewController.commands.cmd_showItemDetails.doCommand(aAddon, true);});'
@lelinhtinh
lelinhtinh / .jshintrc file for jQuery plugin
Last active August 29, 2015 14:18
.jshintrc dành cho jQuery plugin
{
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"expr": true,
"immed": true,
"noarg": true,
"onevar": true,
"quotmark": "single",
@lelinhtinh
lelinhtinh / Adobe Brackets disable jslint but allow jshint
Created April 8, 2015 07:51
Vô hiệu hóa jsLint và kích hoạt jsHint trong Adobe Brackets [Debug > Open Preferences File]
"language": {
"javascript": {
"linting.prefer": [
"JSHint"
],
"linting.usePreferredOnly": true
}
}
@lelinhtinh
lelinhtinh / Reverse string
Created April 5, 2015 06:26
Đảo ngược chuỗi
function reverseString(inputString) {
return inputString.split("").reverse().join("");
}
@lelinhtinh
lelinhtinh / Find the index of integer minimum in array of integers
Created April 5, 2015 06:08
Tìm vị trí của số nhỏ nhất trong mảng các số
function arrayMinimumIndex(inputArray) {
var indexOfMinimum = 0;
for (var i = 1; i < inputArray.length; i++) {
if (inputArray[i] < inputArray[indexOfMinimum]) {
indexOfMinimum = i;
}
}
return indexOfMinimum;
}
@lelinhtinh
lelinhtinh / console.log message color
Created September 15, 2014 10:30
Tô màu cho nội dung console.log
// http://stackoverflow.com/a/10769621
function colorTrace(msg, color) {
console.log("%c" + msg, "color:" + color + ";font-weight:bold;");
}
colorTrace("Test Me", "red");