This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomContainer extends WebMarkupContainer { | |
public CustomContainer(String id) { | |
super(id); | |
} | |
@override | |
public void onBeforeRender() { | |
// Some form do forward message passing for | |
// All Pages/Componets implements IEventSource |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start numbering at 1 | |
set -g base-index 1 | |
# Allows for faster key repetition | |
set -s escape-time 0 | |
# Rather than constraining window size to the maximum size of any client | |
# connected to the *session*, constrain window size to the maximum size of any | |
# client connected to *that window*. Much more reasonable. | |
setw -g aggressive-resize on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.visible = function() { | |
return this.map(function () { | |
if (!_.contains(['none', 'hidden'], $(this).css('display'))) { | |
return this; | |
} | |
}) | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function ucs2_encode(str) | |
local cc = {} | |
local bv = {1, 2, 4, 8, 16, 32, 64, 128} | |
local fmt = "%04x" | |
-- bit_set taken from http://ricilake.blogspot.no/2007/10/iterating-bits-in-lua.html | |
local function bit_set(x, p) | |
return x % (p + p) >= p | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bin2hex (str) | |
local val = "" | |
for i = 1, str:len() do | |
char = string.byte(str:sub(i, i)) | |
val = string.format("%s%02X%s", val, char, "") | |
end | |
return val | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function strpos (haystack, needle, offset) | |
local pattern = string.format("(%s)", needle) | |
local i = string.find (haystack, pattern, (offset or 0)) | |
return (i ~= nil and i or false) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function date (format, timestamp) | |
-- @credits https://raw.github.com/kvz/phpjs/master/functions/datetime/date.js | |
local c = {} | |
local f = nil | |
local formatPattern = "%a" | |
local pad = function (v, s) | |
v = tostring(v) | |
if string.len(v) < s then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Downdload the latest distribution from http://nodejs.org | |
# 2. Extract the nodejs distribution | |
$> tar zxvf node-{version}.tar.gz | |
$> cd node-{version} | |
# 3. Configure and gmake with the location for your distribution i.e. | |
$> ./configure --prefix=$HOME/local | |
$> gmake | |
$> gmake install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
LUA variant of the php serialize function | |
Port of http://phpjs.org/functions/unserialize | |
]]-- | |
function serialize (mixed_value) | |
-- body | |
local val, key, okey, | |
ktype, vals, count, _type; | |
ktype = ''; vals = ''; count = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
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 |