This file contains 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 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 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 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 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 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
[Desktop Entry] | |
Name=IntelliJ | |
Comment=The Best Java and Polyglot IDE | |
Exec=/home/cristobal/Applications/idea-<version>/bin/idea.sh | |
Icon=/home/cristobal/Applications/idea-<version>/bin/idea.png | |
Terminal=false | |
StartupNotify=true | |
Type=Application | |
Categories=Development;IDE; |
This file contains 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
-- Remember to seed outside the function i.e. at top of your script | |
-- especially on OSX otherwise you will get the same permutations. | |
-- math.randomseed(os.time()) | |
-- More info http://lua-users.org/wiki/MathLibraryTutorial | |
function random(min, max) | |
if (max == null) then | |
max = min | |
min = 0 | |
end |
This file contains 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
public class JavaTutorial10 { | |
public static void main(String[] args) { | |
String value = "abc"; | |
// 1. Strings are not null terminated in java | |
System.out.println(value.toCharArray()); | |
System.out.println(""); |
This file contains 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
#!/usr/bin/env python | |
import sys | |
from random import shuffle | |
def main(): | |
langs = ["coffe", "node", "lua", "python", "ruby", "php"] | |
scores = {} | |
for lang in langs: | |
scores[lang] = 0 |
This file contains 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
# Install Haxe using Brew and set the haxelib path | |
brew install haxe | |
haxelib setup /usr/local/Cellar/haxe/lib | |
# Install lime | |
haxelib install lime | |
haxelib run lime setup | |
# Install lime tools | |
haxelib install format |