Skip to content

Instantly share code, notes, and snippets.

var i = "initialized";
function test() {
var i = 0;
for (i in [1, 2, 3]) { console.log(i) };
}
test();
console.log(i);
@hozaka
hozaka / gist:3704928
Created September 12, 2012 07:21
for NeoCyon
# Client side should check the activation status of current account.
# If not you should popup an input dialog for the user to enter their activation code.
#
# CLIENT SIDE CODE SAMPLE
def login(user_id, password)
user = User.validate_login_from_server(user_id, password)
if user.nil?
# provided user_id or password is incorrect.
# show an error message on client
@hozaka
hozaka / float-label-pattern.html
Last active August 29, 2015 13:56
A float label implement with validation by pure css
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>Float Label Pattern</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<style type="text/css" media="screen">
.row {
/*position: relative;*/
padding-top: 24px;
@hozaka
hozaka / gist:41df51fc9c41be000436
Created July 13, 2015 14:46
Github Desktop crash log
Process: GitHub [7276]
Path: /Applications/GitHub.app/Contents/MacOS/GitHub
Identifier: com.github.GitHub
Version: The Sum of All Feels (208)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: GitHub [7276]
User ID: 501
Date/Time: 2015-07-13 22:38:01.213 +0800
@hozaka
hozaka / SSLedge.conf
Created October 14, 2015 15:08
Surge Rules
[Rule]
IP-CIDR,127.0.0.0/8,DIRECT
IP-CIDR,172.16.0.0/12,DIRECT
IP-CIDR,10.0.0.0/8,DIRECT
IP-CIDR,192.168.0.0/16,DIRECT
DOMAIN-SUFFIX,oa.com,DIRECT
DOMAIN-SUFFIX,qq.com,DIRECT
DOMAIN-SUFFIX,cn,DIRECT
DOMAIN-SUFFIX,mzstatic.com,DIRECT
DOMAIN-SUFFIX,phobos.apple.com,DIRECT
@hozaka
hozaka / DefaultKeyBinding.dict
Created August 13, 2022 04:32
HOME & END keybinding for macOS
// Save to ~/Library/KeyBindings/DefaultKeyBinding.dict
{
"\UF729" = moveToBeginningOfParagraph:; // home
"\UF72B" = moveToEndOfParagraph:; // end
"$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end
"^\UF729" = moveToBeginningOfDocument:; // ctrl-home
"^\UF72B" = moveToEndOfDocument:; // ctrl-end
"^$\UF729" = moveToBeginningOfDocumentAndModifySelection:; // ctrl-shift-home