Skip to content

Instantly share code, notes, and snippets.

View nhanb's full-sized avatar

Nhân nhanb

View GitHub Profile
@nhanb
nhanb / autoexec.cfg
Created September 5, 2021 03:23
My CSGO shopping binds
bind "kp_ins" " buy vesthelm; buy vest;"
bind "kp_del" " buy defuser;"
bind "kp_leftarrow" " buy hegrenade;"
bind "kp_pgdn" " buy flashbang;"
bind "kp_5" " buy smokegrenade;"
bind "kp_end" " buy incgrenade; buy molotov;"
bind "kp_downarrow" " buy decoy;"
bind "kp_enter" "buy awp;"
bind "kp_plus" "buy m4a1; buy ak47;"
bind "kp_minus" "buy sg556; buy aug;"
@nhanb
nhanb / wrapka.js
Last active March 6, 2018 03:11
Kissmanga unobfuscated wrapKA() function
// Works with
// https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.min.js
var input = 'mqE5Ec6bMuj1NMBmDOpSx0VBunV1Woj3jJ9/6VAhx6+El9bfvbhuRNIsjbkRWuvXrFTfCgZukx+MAHwkMN5VGolvTK/P24u4BOECXcLudQtgHLD5SKtSKHQeH1cthYMiOP40YKbPD0CtxpIVhCphdMpArArqhVFwdixEO/B+aIQAjHY355p+8AVwWvuSj6qSN79mBQ9ATkzCDvLdi0Y4V9yManh6/gbY/jSVZnvmJqAjgqRNUbTKrpkw90aReGYY';
var iv = CryptoJS.enc.Hex.parse('a5e8e2e9c2721be0a84ad660c472c1f3');
var key = CryptoJS.SHA256("034nsdfns72nasdasd");
var r20 = CryptoJS.lib.CipherParams.create({
ciphertext: CryptoJS.enc.Base64.parse(input)
@nhanb
nhanb / terminalrc
Last active August 28, 2015 04:54
My xfce4-terminal's terminalrc using Solarized Dark. Note that the `ColorCursor=` fixes the bug where the character under cursor is illegible if it has the same color as the cursor.
[Configuration]
ColorForeground=#839496
ColorBackground=#002b36
FontName=DejaVu Sans Mono for Powerline 10
MiscAlwaysShowTabs=FALSE
MiscBell=FALSE
MiscBordersDefault=TRUE
MiscCursorBlinks=FALSE
MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK
MiscDefaultGeometry=80x24
From d976a64f560510125bfddf02bd892d42bc94e5b5 Mon Sep 17 00:00:00 2001
From: nhanb <nhan@nerdyweekly.com>
Date: Thu, 29 Jan 2015 21:42:52 +0700
Subject: [PATCH] add 'j' to WordBreakSyms
I type in VNI style so `j` doesn't need to be processed by unikey at
all. Making `j` a WordBreakSym prevents unikey from hijacking my `jj`
keymap in vim.
---
src/unikey-im.cpp | 2 +-
@nhanb
nhanb / postmkvirtualenv
Created September 22, 2014 15:03
postmkvirtualenv
#!/usr/bin/env bash
# This hook is sourced after a new virtualenv is activated.
# Automatically create symlink to project-specific virtualenv hook
hook="`pwd`/.virtualenv/postactivate"
if [[ -e "$hook" ]]; then
rm -f $VIRTUAL_ENV/bin/postactivate
ln -s $hook $VIRTUAL_ENV/bin/postactivate
fi
@nhanb
nhanb / config.cfg
Created June 9, 2014 12:07
CS 1.6 config. Adapted from SpawN's http://www.sk-gaming.com/member/SpawN
unbindall
bind "TAB" "+showscores"
bind "ENTER" "+attack"
bind "ESCAPE" "cancelselect"
bind "SPACE" "+jump"
bind "'" "+moveup"
bind "+" "sizeup"
bind "," "buyammo1"
bind "-" "sizedown"
bind "." "buyammo2"
@nhanb
nhanb / typewriter.js
Last active August 29, 2015 14:01
Typewriter effect in plain javascript
/**
* content: string to be "typed out"
* el: parent element to write content in
* delay: miliseconds between each char
*
* Example usage:
* typewriter("Look ma, no hands!", document.getElementById("container"), 100);
*/
var typewriter = function(content, el, delay) {
var p = document.createElement('p');
import os
import urllib
from google.appengine.datastore.datastore_query import Cursor
import jinja2
import webapp2
import datetime
from google.appengine.ext import ndb
def toFullwidth(halfwidth):
# Only convert these characters
en_chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~'
def shift(char):
return unichr(0XFEE0 + ord(c)) if char in en_chars else char
return u''.join([shift(c) for c in halfwidth])
@nhanb
nhanb / clean.sh
Last active August 29, 2015 13:58
clean up non-ascii characters
# Run this in _posts, obviously
files=`find . -name "*.mkd"`
for file in $files; do
sed -i 's/–/-/g' $file
sed -i 's/ / /g' $file
sed -i "s/’/'/g" $file
sed -i "s/‘/'/g" $file
sed -i 's/“/"/g' $file
sed -i 's/”/"/g' $file
sed -i 's/…/.../g' $file