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=
/*! rasterizeHTML.js - v0.5.1 - 2013-11-14
* http://www.github.com/cburgmer/rasterizeHTML.js
* Copyright (c) 2013 Christoph Burgmer;
/* Integrated dependencies:
* URI.js (MIT License/GPL v3),
* CSSOM (MIT License),
* xmlserializer (MIT License) */
!function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.CSSOM=a():"undefined"!=typeof global?global.CSSOM=a():"undefined"!=typeof self&&(self.CSSOM=a())}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){var d={CSSRule:a("./CSSRule").CSSRule,MatcherList:a("./MatcherList").MatcherList};d.CSSDocument
@grimen
grimen / FAIL.log
Last active December 24, 2015 22:39
cat ./input.png | potrace > ./output.eps
P4
393 500
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
@grimen
grimen / .env
Last active December 24, 2015 20:29
Automaticall generate unique/predicatable/consistent $PORT for each project based on fingerprinting of `.powder` and make Pow Proxy aware of it.
# custom ENV variables