Skip to content

Instantly share code, notes, and snippets.

View dominykas's full-sized avatar

Dominykas Blyžė dominykas

View GitHub Profile
@dominykas
dominykas / README.md
Created August 4, 2014 11:07
Hide creeps on Analytics login
  • Install Tampermonkey
  • Create new user script and paste the contents of userscript.js there
<!doctype html>
<html>
<head>
<title>Scrolly cart trial</title>
<style>
* {
box-sizing: border-box;
}
body {
["log", "info", "warn", "error"].forEach(function (k) {
var originalFn = console[k];
console[k] = function (s, o) {
if (arguments.length == 1 && typeof(s) == "string") {
originalFn.call(this, s + " " + JSON.stringify({message: s}));
return;
}
if (arguments.length == 2 && typeof(s) == "string" && typeof (o) == "object") {
dominykas@patti ~/.npm/lodash/0.5.2 $ tail -n 6 /Users/dominykas/devel/projects/iw-insidewarehouse/apps/os-run/node_modules/buster/node_modules/buster-test-cli/node_modules/ramp/node_modules/ramp-resources/node_modules/lodash/package.json
"dist": {
"shasum": "0809fb891235993d6497dd6b526fb92cefa01768"
},
"_from": "lodash@~0.5",
"_resolved": "https://registry.npmjs.org/lodash/-/lodash-0.5.2.tgz"
}
dominykas@patti ~/.npm/lodash/0.5.2 $ shasum package.tgz
0809fb891235993d6497dd6b526fb92cefa01768 package.tgz
@dominykas
dominykas / 10vagrant
Last active August 29, 2015 13:56
Use this to get NFS on vagrant to work without password on CentOS: /etc/sudoers/10vagrant
Cmnd_Alias NFS_APPLY = /usr/sbin/exportfs -ar
Cmnd_Alias NFS_START = /etc/init.d/nfs-kernel-server start
Cmnd_Alias NFS_RESTART = /sbin/service nfs restart
Cmnd_Alias EXPORT_CLEANUP = /bin/sed -r -e * -ibak /etc/exports
Cmnd_Alias EXPORT_ADD = /usr/bin/tee -a /etc/exports
%vboxusers ALL=(root) NOPASSWD: NFS_APPLY, NFS_START, NFS_RESTART, EXPORT_CLEANUP, EXPORT_ADD
@dominykas
dominykas / hn.js
Last active August 29, 2015 13:56 — forked from edvinasbartkus/hn.js
Parse('https://news.ycombinator.com/item?id=7216471')
.filter('#element:.comment')
.filter('#text')
.filter(function (text) {
return text !='reply'
})
.join('')
.then(function (comments) {
console.log(comments);
process.exit(0);
@dominykas
dominykas / grid.html
Last active January 2, 2016 20:19
Scrolly Grid
<html>
<head>
<title>Scrolly grid test</title>
<style>
.container {
padding: 4px;
width: 600px;
background-color: rgba(0,0,0,.1);
-moz-box-sizing: border-box;
@dominykas
dominykas / trackingCookie.js
Created January 9, 2014 07:05
Tracking cookie for hapi
var uuid = require("node-uuid");
var TRACKING_COOKIE_NAME = "trackingId";
var UUID_REGEX = /^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/;
module.exports.register = function (server) {
server.state(TRACKING_COOKIE_NAME, {
ttl: 2 * 365 * 86400 * 1000,
path: "/"
});
var config = module.exports;
config["reduced-test-case"] = {
rootPath: ".",
environment: "browser",
sources: [
"dostuff.js"
],
tests:[
"test.js"
@dominykas
dominykas / output.txt
Created August 1, 2013 13:10
req.params get overwritten
For http://localhost:3000/1 the following output will be produced:
Matched /:id
[ id: '1' ]
Matched /*
[ '1' ]
Timeout in /:id
[ '1' ]
Notice how req.params inside the /:id handler has changed.