Skip to content

Instantly share code, notes, and snippets.

{
"bold_folder_labels": true,
"build_on_save": false,
"caret_style": "phase",
"close_windows_when_empty": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"default": "Default.sublime-theme",
"detect_indentation": false,
"draw_indent_guides": true,
"draw_minimap_border": true,
@phaistonian
phaistonian / .eslintrc
Last active April 11, 2016 06:58
To be used in projects, Sublime Text, VIM etc.
{
"parser": "babel-eslint",
"ecmaFeatures": {
"jsx": true,
"modules": true,
"classes": true,
"generators": true,
"experimentalObjectRestSpread": true
},
var hash = {};
[1,2,3,3,5,1].filter(function (item) { if (hash[item]) return true; hash[item] = false; return true; });
@phaistonian
phaistonian / Select Similar.sketchplugin
Last active August 29, 2015 14:06
Sketch: Select similar layers or groups based on a number of properties (and guesses)
// Select Similar (ctrl shift a)
// https://gist.githubusercontent.com/phaistonian/b3737cf05c1b6a61dbb7/raw/1f1ca90f1c72e395cb4d2abfc23315c47dc5c25d/Select%20Similar.sketchplugin
/* Based on initial work by Ale Muñoz */
(function(){
var sel = selection[0], all_layers = [[doc currentPage] children];
if (sel) {
var query = getIdForElement(sel), type = [sel className], found = 0;
{
"bold_folder_labels": true,
"build_on_save": 0,
"color_scheme": "Packages/User/Tomorrow-Night.tmTheme",
"close_windows_when_empty": true,
"draw_indent_guides": true,
"caret_style": "phase",
"fallback_encoding": "Greek (ISO 8859-7)",
"folder_exclude_patterns":
[
@phaistonian
phaistonian / gist:5542793
Created May 8, 2013 19:05
d2_min_take 2
[ '20', '3', '30', '10' ].sort(function (a, b) {
return a == b ? 0 : (a < b ? -1 : 1);
})[0];
[ 20, 3, 30, 10 ].sort(function (a, b) {
return a == b ? 0 : (a < b ? -1 : 1);
})[0];
@phaistonian
phaistonian / d3_min_altered
Created May 8, 2013 13:54
A d3_min variation. Use native Math.min method if applicable for faster results.
d3.min = function(array, f) {
var i = -1, n = array.length, a, b;
if (!f) {
for (var y = 0; parseInt(array[y]); y++) {}
if (y === array.length) return Math.min.apply(Math, array);
}
// Continue existing logic below
subClass = function (source, prototype) {
var dummy = new source.constructor;
for (var key in prototype) {
dummy[key] = prototype[key];
}
source.__proto__ = dummy;
}