Skip to content

Instantly share code, notes, and snippets.

View oroce's full-sized avatar

Róbert Oroszi oroce

  • Budapest, Hungary
View GitHub Profile
function onport(){
lsof -n -i4TCP:$1 | grep LISTEN
}
function tmuxhelp() {
open "https://gist.github.com/henrik/1967800"
}
@oroce
oroce / package.json
Created September 4, 2018 11:29
reducer test
{
"scripts": "mocha -r should '*.spec.js'"
}
@oroce
oroce / action.js
Last active September 4, 2018 11:25
testing an action
export function simple(num) {
return {
type: 'add',
payload: {
num
}
};
}
export function withDispatch(num) {
(function (window, document, script, raven, el, first, loaded) {
raven = [];
window.onerror = function e(message, file, line, colno, ex) {
if (loaded) {
return;
}
raven.push([message, file, colno, ex]);
};
el = document.createElement(script);
first = document.getElementsByTagName(script)[0];
@oroce
oroce / app.js
Created June 17, 2014 08:37
parse csp report in express
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
// chrome sends application/csp-report
// firefox sends application/json
// it seems chrome is doing it well: https://w3c.github.io/webappsec/specs/content-security-policy/
app.use(bodyParser.json({
type: ['json', 'application/csp-report']
}));
<!DOCTYPE html><!--
about:version template page
--><html xmlns="http://www.w3.org/1999/xhtml" id="t" dir="ltr" lang="en" i18n-processed=""><head>
<meta charset="utf-8" />
<title>About Version</title>
<link rel="stylesheet" href="chrome://resources/css/text_defaults.css" />
<link rel="stylesheet" href="chrome://version/about_version.css" />
npm i https://github.com/purposeindustries/yslow-nodejs
curl "https://www.webpagetest.org/export.php?test=170710_HJ_1AD8&run=2&cached=0&bodies=1&pretty=1" -o blog.intellyo.com.har
$(npm bin)/yslow-nodejs blog.intellyo.com.har
@oroce
oroce / gist:eeddcf623ff90dd8fbf8d9e21214b73c
Created July 16, 2016 21:03 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@oroce
oroce / esnextbin.md
Created April 25, 2017 13:28
esnextbin sketch
@oroce
oroce / .lintr
Last active April 10, 2017 20:42
linters: with_defaults(line_length_linter(120))
exclusions: list("lint.R")