Skip to content

Instantly share code, notes, and snippets.

View haggen's full-sized avatar

Arthur Corenzan haggen

View GitHub Profile
@haggen
haggen / remote-env
Last active August 29, 2015 14:06
Set and unset .env entries in a remote host
#!/usr/bin/env bash
# Usage:
#
# $ remote-env set A=1 B=2
# $ remote-env unset A B
#
TARGET='app@54.84.22.17'
FILE='~/app/.env'
function Calendar(input) {
this.input = $(input);
this.setDate(this.input.val() || moment(), 'MMMM D, YYYY');
this.container = $('<div class="calendar"></div>');
this.input.on('focus', $.proxy(function(e) {
this.open();
@haggen
haggen / Query.lua
Created October 21, 2014 22:51
Query items in OpenEUO
function table.has(t, needle)
for _, value in ipairs(t) do
if value == needle then return true end
end
return false
end
function table.each(t, closure)
@haggen
haggen / DRAFT.md
Created November 9, 2014 18:13
Stockmarket simulator draft

User @name @email @password_digest

Wallet @owner @balance

@haggen
haggen / README.md
Last active August 29, 2015 14:11
EVE Spreadsheet Extension

EVE Spreadsheet Extension

Instructions

  1. Open your Spreadsheet, on the menu choose Tools, then Script editor
  2. When it prompt you to create a script, choose to create for Spreadsheet
  3. Replace everything in the editor with the source of script below
  4. Save it, naming it with whatever suits your fancy
  5. Done, go back to your spreadsheet and use the formula as described below:
@haggen
haggen / inflection.js
Created January 16, 2015 15:07
InflectionJS
/*
Copyright (c) 2010 Ryan Schuft (ryan.schuft@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@haggen
haggen / filepicker.js
Last active August 29, 2015 14:15
Simple file picking in JS.
// Simple file picking in JS
// by Arthur <arthur@corenzan.com>
// on Fri Feb 13 15:32:28 BRST 2015
function openFilePicker(fn, multiple, accept) {
var input = document.createElement('input');
input.type = 'file';
input.accept = accept === undefined ? null : accept;
input.multiple = multiple === undefined ? true : multiple;
@haggen
haggen / dabblet.css
Created February 18, 2015 19:48
Reference Grid with CSS gradient
/* Reference Grid with CSS gradient */
* {
padding: 0;
margin: 0;
}
body {
background:
repeating-linear-gradient(180deg, transparent 0, transparent 50%, rgba(0, 0, 0, .125) 50%, rgba(0, 0, 0, .125) 100%),
@haggen
haggen / dabblet.css
Created March 17, 2015 16:12
CSS toolbar spacing using Flex
/**
* CSS toolbar spacing using Flex
*/
* {
padding: 0;
margin: 0;
}
.row {
@haggen
haggen / debug.js
Created March 20, 2015 16:48
Debug CSS: bookmarklet to outline all elements randomizing its color.
// Debug CSS: bookmarklet to outline all elements randomizing its color.
// javascript:
;(function() {
[].forEach.call(document.querySelectorAll('*'), function(el) {
el.style.outline = '1px solid #' + (Math.random() * 100).toString(16).replace('.', '').slice(0, 6);
});
}).call(this);