Skip to content

Instantly share code, notes, and snippets.

Avatar

Róbert Oroszi oroce

  • vernsurance
  • Budapest, Hungary
View GitHub Profile
@oroce
oroce / nginx.conf
Created Jan 31, 2014
nginx config for using grafana, elasticsearch and graphite with authentication.
View nginx.conf
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
sendfile on;
@oroce
oroce / package.json
Created Apr 25, 2014
run eslint only on changed (*.js files) files using pre-commit
View package.json
{
"scripts": {
"eslint": "LIST=`git diff-index --name-only HEAD | grep .*\\.js | grep -v json`; if [ \"$LIST\" ]; then eslint $LIST; fi"
},
"devDependencies": {
"pre-commit": "0.0.7",
"eslint": "~0.5.1"
},
"pre-commit": [
"eslint"
@oroce
oroce / app.js
Last active Sep 26, 2020
Redirect express while keeping params
View app.js
/*
URLs:
http://localhost:3000/arrive?foo=bar&utm_source=smart-redir
*/
var redirect = require('redirect-with-params');
var express = require('express');
var app = express();
app.use(redirect({
@oroce
oroce / huginn.debug.js
Last active Sep 1, 2020
Huginn javascript agent stuff
View huginn.debug.js
var Agent = {};
Agent.check = function() {
var events = JSON.parse(this.memory('events') || '[]');
this.log('memory is: (' + typeof events + '):' + JSON.stringify(events));
var len = events.length;
var tags = (this.options('tags') || '').split(',');
var count = parseInt(this.options('count'), 10) || tags.length;
var delimeter = this.options('delimeter') || ',';
var tagPrefix = this.options('tagPrefix') || this.options('tagprefix') || '';
if (len === 0) {
@oroce
oroce / package.json
Created Mar 31, 2014
pre and post hooks in npm custom script
View package.json
{
"scripts": {
"such-custom-script": "echo custom-script",
"presuch-custom-script": "echo pre-custom-script",
"postsuch-custom-script": "echo post-custom-script"
}
}
@oroce
oroce / README.md
Created Jun 12, 2014
nginx request id
View README.md
View blocked.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>Menetrend Online</title>
<link id="screencss" href="style01.css" rel="stylesheet" type="text/css" media="screen">
<link id="printcss" href="print.css" rel="stylesheet" type="text/css" media="print">
<script type="text/javascript" src="scripts.php"></script>
View .functions
function onport(){
lsof -n -i4TCP:$1 | grep LISTEN
}
function tmuxhelp() {
open "https://gist.github.com/henrik/1967800"
}
View package.json
{
"scripts": "mocha -r should '*.spec.js'"
}
@oroce
oroce / action.js
Last active Sep 4, 2018
testing an action
View action.js
export function simple(num) {
return {
type: 'add',
payload: {
num
}
};
}
export function withDispatch(num) {