Skip to content

Instantly share code, notes, and snippets.

<script type="text/javascript">
// Extend original Billing class and overwrite newAddress method
var BillingCustom = new Class.create(Billing, {
//$super represents the original function
newAddress: function($super, isNew) {
$super(isNew); // call original function. You don't have to call the original function you may or may not want to. You might just copy the original function and adapt it.
// Do something else here after calling the original function
}
@honewatson
honewatson / nimlang-closure.nim
Created January 18, 2015 22:46
Closure example ( nimlang, nimrod, nim lang )
proc tc(a:int): proc =
return proc (b:int): int =
return a + b
var x: proc = tc(1)
echo x(2)
@honewatson
honewatson / gist:a6565f3d06cc5abe3f03
Created January 19, 2015 00:46
Table example ( nimlang, nimrod, nim lang)
import tables, hashes
echo "Not ordered table"
var t = {"key1": "value1", "key2":"computer blue", "key3": "value2"}.newTable
t.add("blue", "b")
echo t["blue"]
@honewatson
honewatson / gist:c2f035c07ef06f797514
Last active August 29, 2015 14:13
Install Nim, Nimble, and Aporia on Ubuntu 14.04
cd
mkdir bin
export PATH=$PATH:$HOME/bin
git clone git://github.com/Araq/Nim.git
cd Nim
git clone --depth 1 git://github.com/nim-lang/csources
cd csources && sh build.sh
cd ..
bin/nim c koch
./koch boot -d:release
@honewatson
honewatson / EsExample.js
Created March 2, 2016 02:40
Eslint Example For Vim with es6 babel-eslint parser
// Eslint npm install eslint-plugin-babel -D && ln -s node_modules/eslint/bin/eslint.js eslint
// Also the dependency for .vimrc
/*
let g:syntastic_javascript_checkers = ['eslint']
" Override eslint with local version where necessary.
let local_eslint = finddir('node_modules', '.;') . '/.bin/eslint'
if matchstr(local_eslint, "^\/\\w") == ''
let local_eslint = getcwd() . "/" . local_eslint
endif
@honewatson
honewatson / queries.sql
Created April 5, 2016 23:50 — forked from whodidthis/queries.sql
YES for pgmoon too, because YeSQL
-- name: get_cools
SELECT *
FROM cools
-- name: insert_a_cool
INSERT INTO cools
(name, why)
VALUES
(?, ?)
RETURNING level
var b = [];
var f;
var s = document.createElement('script');
s.src = 'https://code.jquery.com/jquery-1.11.1.min.js';
s.onload = function() {
var ifr = window.jQuery('.iframe-container.main iframe')[0];
f = new F(ifr.contentWindow, ifr.contentDocument, ifr.contentWindow.jQuery, ifr.contentWindow.EasyEdit, ifr.contentWindow.EasyEdit.wizard);
};
document.body.appendChild(s);
var F = function(window, document, $, EasyEdit, wizard) {
local function loader(file)
local f = io.open(file, "rb")
assert(f, "file not found")
local c = f:read("*all")
f:close()
return c
end
local function sqlType(params, sql)
return {params = params, sql = sql}
@honewatson
honewatson / LUA unserialize
Created April 19, 2016 23:27 — forked from cristobal/LUA unserialize
Lua php unserialize port
--[[
LUA variant of the php unserialize function
Port of http://phpjs.org/functions/unserialize
]]--
local function unserialize (data)
local function utf8Overhead (chr)
local code = chr:byte()
if (code < 0x0080) then
return 0
asset_type: Container Template
asset_name: Accordion
asset_parent_name: Configuration/Container Templates
content_files_dir: content_files/container_templates/accordion/
auth_layout: auth_layout.html
auth_js: auth.js
auth_css: auth.css
frontend_layout: frontend_layut.html
frontend_js: frontend.js
frontend_css: frontend.css