Skip to content

Instantly share code, notes, and snippets.

View timuric's full-sized avatar

Timur Carpeev timuric

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<p>
Nothing here yet...
</p>
var meaninglessWords = ['stunning','nice','amaizing','bro','wow','good job','great job','great','neat','sick','fucking','hah','haha','cool','coool','gorgeous','clean','as always','fantastic','brilliant','bloody','genious','love','freaking','insane','sexy','beautiful',':)','whoa','dope','lovely','like','mate','dang','dude','rad','super','is','so','that','this','i','it','oh'];
var isBulshitSentence = x => x.split(" ").filter(x=>!~meaninglessWords.indexOf(x.replace(/\!\.\,/g,"").toLowerCase())).length < 3;
[].slice.call(document.querySelectorAll('.comment-body')).forEach(x=>isBulshitSentence(x.innerText) && x.remove());
function dump_obj(obj){
log("#####################################################################################")
log("## Dumping object " + obj )
log("## obj class is: " + [obj className])
log("#####################################################################################")
log("obj.properties:")
log("#####################################################################################")
log([obj class].mocha().properties())
log("obj.propertiesWithAncestors:")
log([obj class].mocha().propertiesWithAncestors())
@timuric
timuric / export-layer
Last active August 29, 2015 14:02
Export layers in sketch app
function exportLayer(layer,path){
var rect = [layer rectByAccountingForStyleSize:[[layer absoluteRect] rect]];
var slice = [[MSSliceMaker slicesFromExportableLayer:layer inRect:rect] firstObject];
[doc saveArtboardOrSlice: slice toFile: path];
}