Skip to content

Instantly share code, notes, and snippets.

View grimen's full-sized avatar

Jonas Grimfelt grimen

View GitHub Profile
@grimen
grimen / .eslintrc
Last active January 12, 2017 20:32
ESLint config
{
"extends": [
"eslint:recommended",
"airbnb-base"
],
"parser": "babel-eslint",
"env": {
"es6": true,
"node": true
},
@grimen
grimen / SublimeLinter.sublime-settings
Created January 3, 2017 16:02
SublimeLinter - User
{
"user": {
"debug": true,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"eslint": {
@grimen
grimen / index.js
Last active October 23, 2016 20:23
'use strict'
const cluster = require('cluster')
const assert = require('assert')
const util = require('util')
const os = require('os')
const PrettyError = require('pretty-error')
process.env.NODE_ENV = process.env.NODE_ENV || 'development'
process.env.NODE_CLUSTER = process.env.NODE_CLUSTER || process.env.WEB_CONCURRENCY // heroku
process.env.DEBUG = process.env.DEBUG || 'app*'
/*eslint-env es6:false*/
/*
* Copyright (c) 2010 Arc90 Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
#!/usr/bin/env sh
# Install Luvit
cd /
curl -L https://github.com/luvit/lit/raw/master/get-lit.sh | sh
/lit make lit://luvit/luvit
# Get example script
curl -O https://gist.githubusercontent.com/grimen/8163a5177e9e8603b1b6/raw/5cade52f6703eb99f7afff41035f5d99f5f7c9bf/luvit.lua
local http = require('http')
http.createServer(function (req, res)
local body = "Hello world\n"
res:setHeader("Content-Type", "text/plain")
res:setHeader("Content-Length", #body)
res:finish(body)
end):listen(1337, '127.0.0.1')
print('Server running at http://127.0.0.1:1337/')
location /validate {
# IF:
# /validate?param1=value
# /validate?param0=x&param1=value
rewrite ^/validate?.*param1\=(.+).*$ /success/$1 last;
# ELSE:
# /validate?param0=x
# /validate?param0=x&param1
# /validate?param0=x&param1=
@grimen
grimen / common.conf
Last active August 29, 2015 14:26
$ ./mitmiproxy.sh
port = 8085
Verifying I am +grimen on my passcard. https://onename.com/grimen
Verifying I am +grimen on my passcard. https://onename.com/grimen