Skip to content

Instantly share code, notes, and snippets.

View glepur's full-sized avatar

Goran Lepur glepur

  • Croatia
View GitHub Profile
@glepur
glepur / node_helper_functions.js
Created May 14, 2018 15:55
Improved promise and error handling in nodejs.
//*** HELPER FUNCTIONS ***
//*** npm install parse-error
pe = require('parse-error');
to = function(promise) {
return promise
.then(data => {
return [null, data];
}).catch(err =>
[pe(err)]
);
html {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%
}
body {
margin: 0;
font: 16px/1 sans-serif;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased
@glepur
glepur / like-spammer
Created August 3, 2014 16:06
Facebook like spam - add to bookmark and press on facebook page to "like" everything
javascript: (function () {
var a = document.getElementsByTagName("a");
var content = document.getElementById("contentArea");
for(var i=0;i<a.length;i++){
if(a[i].innerHTML=="Like" && hasParent(a[i],content))
a[i].click();
}
@glepur
glepur / clear_both
Created December 9, 2013 13:43
Best way to clear:both in css
.clear:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}