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 to flatten the deep array | |
*/ | |
var sampleArray = [[1, 2],[3, 4, 5], [6, 7, 8, 9]]; | |
// Solution for single level nested array | |
[].concat.apply([], sampleArray); | |
// If we want deep flatten then we can use recursive function strategy |
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
Create recent application dock item in Mac | |
defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }' && killall Dock | |
https://discussions.apple.com/thread/3217726?tstart=0 | |
Use smart folder option to create recent filter in sidebar. |
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
[ | |
{ "keys": ["alt+d"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} }, | |
{ "keys": ["alt+w"], "command": "toggle_setting", "args": {"setting": "word_wrap"} }, | |
{ "keys": ["ctrl+b"], "command": "toggle_side_bar" } | |
] |
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
Alignment | |
Terminal | |
DocBlocker | |
Emmet | |
trimmer | |
csscomb | |
Color Highlighter | |
jsFormat | |
plainTask | |
AllAutocomplete |
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
/** | |
* Linear Congruential Generator | |
* http://en.wikipedia.org/wiki/Linear_congruential_generator | |
*/ | |
function RandomNumberGeneratorFn($log) { | |
'use strict'; | |
$log = $log || console; |
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
/* Striping */ | |
tr.alternate { | |
background-color:#ffffcc; | |
} | |
/* Sorting */ | |
th.table-sortable { | |
cursor:pointer; | |
background-position:center left; | |
background-repeat:no-repeat; |
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
console.log('%cHello world', 'font-size:100px;color:#fff;text-shadow:0 1px 0 #ccc,0 2px 0 #c9c9c9,0 3px 0 #bbb,0 4px 0 #b9b9b9,0 5px 0 #aaa,0 6px 1px rgba(0,0,0,.1),0 0 5px rgba(0,0,0,.1),0 1px 3px rgba(0,0,0,.3),0 3px 5px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.25),0 10px 10px rgba(0,0,0,.2),0 20px 20px rgba(0,0,0,.15);'); |
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($) { | |
$.fn.clickToggle = function(func1, func2) { | |
var funcs = [func1, func2]; | |
this.data('toggleclicked', 0); | |
this.click(function() { | |
var data = $(this).data(); | |
var tc = data.toggleclicked; | |
$.proxy(funcs[tc], this)(); | |
data.toggleclicked = (tc + 1) % 2; | |
}); |
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
/** | |
* Module for QHash Application | |
* @author : Amitesh Kumar | |
* | |
*/ | |
window.QHash = window.QHash || {}; | |
( function ( QHash ) { | |
/** | |
* Answer Model |
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
sudo vi /etc/udev/rules.d/99-android.rules | |
http://developer.android.com/tools/device.html | |
http://www.reactivated.net/writing_udev_rules.html | |
http://eagle.phys.utk.edu/guidry/android/installOnDevice.html |