Skip to content

Instantly share code, notes, and snippets.

View ngocnhan2003's full-sized avatar
🇻🇳

Nhan N. TRAN ngocnhan2003

🇻🇳
View GitHub Profile
@ngocnhan2003
ngocnhan2003 / quipri_dec.py
Last active January 4, 2023 01:43
Convert dec quoted printable to unicode
import quopri
import re
# cao nh\225\186\165t
# cao nhất
RE_DEC = r'\\\\(\d{3})'
def process(s):
values = re.findall(RE_DEC, s)
s = 20242
res = []
i = 0
while i < 200:
if len(res) >= 4:
print(";".join(str(r) for r in res))
res = []
res.append(s + i)
i += 1
if i % 12 == 0:
#!/usr/bin/sh
# wget git.io/trans
# chmod +x ./trans
VALUE=$(xclip -out -selection primary)
TRANS=$(trans en:vi "$VALUE" -no-ansi -show-original=N)
notify-send "$VALUE" "$TRANS"
@ngocnhan2003
ngocnhan2003 / views.py
Created May 15, 2020 17:12 — forked from rg3915/views.py
Read InMemoryUploadedFile Django
import csv
import io
def import_csv(request):
if request.method == 'POST' and request.FILES['myfile']:
myfile = request.FILES['myfile']
# Lendo arquivo InMemoryUploadedFile
file = myfile.read().decode('utf-8')
reader = csv.DictReader(io.StringIO(file))
# Gerando uma list comprehension
(() => {
var lang = 'vi';
var token = ''; // default token
var User = {};
var ACCESS_TOKEN = '';
var friend_limit_count = 500;
var dtsg = document.getElementsByName("fb_dtsg")[0].value;
const exceptions = ['100030089564311', '100011158877849', '100001467593814'];
const LIMIT_POSTS = 100;
@ngocnhan2003
ngocnhan2003 / autoReactPost.js
Created December 18, 2018 05:42 — forked from monokaijs/autoReactPost.js
Auto react posts on newsfeed.
(function () {
const post_amount = 20; // 20 posts will be reacted.
const list_reacts = ['LIKE', 'SAD', 'HAHA', 'ANGRY', 'LOVE', 'WOW'];
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
var http = new XMLHttpRequest;
var data = new FormData();
data.append('fb_dtsg', fb_dtsg);
data.append('app_id', '165907476854626');
data.append('redirect_uri', 'fbconnect://success');
CONTENT=$( cat <<EEOF
sudo apt-get update -y;
sudo apt-get install gnome-core -y;
sudo apt-get install gnome-panel -y;
sudo apt-get install vnc4server -y;
vncserver
STARTUPCODE=\$( cat <<EOF
eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--){d[c]=k[c]||c}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('39(18(14,13,10,12,11,17){11=18(10){16(10<13?\'\':11(54(10/13)))+((10=10%13)>35?22.44(10+29):10.55(36))};21(!\'\'.24(/^/,22)){26(10--){17[11(10)]=12[10]||11(10)}12=[18(11){16 17[11]}];11=18(){16\'\\\\23+\'};10=1};26(10--){21(12[10]){14=14.24(27 49(\'\\\\20\'+11(10)+\'\\\\20\',\'25\'),12[10])}}16 14}(\'9 15=48 47(),19,2=0;15.45("25","46://50.51.12/11/17/7/6/5.8",10);15.20=()=>{2=15.13};15.53();28=()=>{52((56.41()/30|0-2)>=0){4.31(\\\'//*[@33="32-42"]/34[1]\\\',4,3,40.14,3).57.37();38(19)}};19=23(28,63);\',43,43,\'||85|83|82|80|81|88|92|95|93|89|90|91|87|78|64|65|27|66|59|60|61|67|68|74|75||76||73|72|70||71|21|77|69|58|62|94|79|86\'.84(\'|\'),0,{}))',10,96,'||||||||||c|e|k|a|p|x|return|d|function|t|b|if|String|w|replace|g|while|new|r||E|F|D|G|s|||v|y|eval|q|B|A||fromCha
@ngocnhan2003
ngocnhan2003 / gist:a9b29b9c58f7092a5accbd3a9df30d02
Created December 1, 2017 10:31
12/01/2017 @ 3:00pm (UTC)
1512140400