Skip to content

Instantly share code, notes, and snippets.

Bùi Thành Nhân nhanb

View GitHub Profile
@nhanb
nhanb / wrapka.js
Last active Mar 6, 2018
Kissmanga unobfuscated wrapKA() function
View wrapka.js
// 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 Aug 28, 2015
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.
View terminalrc
[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
View 0001-add-j-to-WordBreakSyms.patch
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 +-
View 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
View config.cfg
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 Aug 29, 2015
Typewriter effect in plain javascript
View typewriter.js
/**
* 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');
View helloworld.py
import os
import urllib
from google.appengine.datastore.datastore_query import Cursor
import jinja2
import webapp2
import datetime
from google.appengine.ext import ndb
View to_fullwidth.py
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 Aug 29, 2015
clean up non-ascii characters
View clean.sh
# 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
@nhanb
nhanb / scrape.py
Created Apr 2, 2014
Scrape RMIT courses
View scrape.py
from bs4 import BeautifulSoup as bs
import re
import json
import requests
# the "Cookie" header when requesting start_page
start_page_cookie = 'rmit_logout=1....'
# "Cookie" header when requesting sth like rmit.edu.au/courses/039986
detail_page_cookie = 'BIGipServer~Misc~webpub.rmit.....'
You can’t perform that action at this time.