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
class DictUtils { | |
static entries(dictionary) { | |
try { | |
//ECMAScript 2017 and higher, better performance if support | |
return Object.entries(dictionary); | |
} catch (error) { |
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 sort_object(obj) { | |
items = Object.keys(obj).map(function(key) { | |
return [key, obj[key]]; | |
}); | |
items.sort(function(first, second) { | |
return second[1] - first[1]; | |
}); | |
sorted_obj={} | |
$.each(items, function(k, v) { | |
use_key = v[0] |
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
var dict = { | |
"x": 1, | |
"y": 6, | |
"z": 9, | |
"a": 5, | |
"b": 7, | |
"c": 11, | |
"d": 17, | |
"t": 3 | |
}; |
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
This is gist. | |
There are many like it, but this one is mine. | |
It is my life. | |
I must master it as I must master my life. | |
Without me gist is useless. | |
Without gist, I am useless. |
NewerOlder