Skip to content

Instantly share code, notes, and snippets.

@cinoss
cinoss / gist:2327292
Created April 7, 2012 10:30
python: new class
class ClassName(object):
"""docstring for ClassName"""
def __init__(self, arg):
super(ClassName, self).__init__()
self.arg = arg
@cinoss
cinoss / remove_accents.py
Created April 6, 2016 15:01
Remove Vietnamese Accents - Xoá dấu tiếng việt in Python
s1 = u'ÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚÝàáâãèéêìíòóôõùúýĂăĐđĨĩŨũƠơƯưẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂểỄễỆệỈỉỊịỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮữỰựỲỳỴỵỶỷỸỹ'
s0 = u'AAAAEEEIIOOOOUUYaaaaeeeiioooouuyAaDdIiUuOoUuAaAaAaAaAaAaAaAaAaAaAaAaEeEeEeEeEeEeEeEeIiIiOoOoOoOoOoOoOoOoOoOoOoOoUuUuUuUuUuUuUuYyYyYyYy'
def remove_accents(input_str):
s = ''
print input_str.encode('utf-8')
for c in input_str:
if c in s1:
s += s0[s1.index(c)]
else:
s += c
https://docs.google.com/a/vng.com.vn/presentation/d/1Uy3KiVdKwHCibEKFOf-H3Us1q-_3saYi_6N0h1_t7aY/edit?usp=sharing
@cinoss
cinoss / add-atrpms-on-centos-6-and-install-ffmpeg.md
Last active May 20, 2016 04:56
How to Add ATrpms on CentOS 6/7 and Install FFmpeg 2.x in 3 Simple Steps

How to Add ATrpms on CentOS 6/7 and Install FFmpeg 2.x in 3 Simple Steps

atrpms is basically dead, yet we can still use its mirror to install stuffs by followings steps:

Create RPM-GPG-KEY.atrpms

mkdir /root/rpm # you can put it at any other place
vim /root/rpm/RPM-GPG-KEY.atrpms

This we can get by simply google the file name, some github repo with the key will show up.

Keybase proof

I hereby claim:

  • I am cinoss on github.
  • I am cinoss (https://keybase.io/cinoss) on keybase.
  • I have a public key ASByfO6Vi8L_5o2l4aIKf8IgXNPxpGONLteRWw49wYh8xgo

To claim this, I am signing this object:

Yu-Gi-Oh! Forbidden Memories - Battle Rank

Mix.install([
  {:kino, "~> 0.12.3"}
])
@cinoss
cinoss / @absinthe+socket+0.2.1.patch
Last active October 18, 2024 16:41
Temporary fix for JS Absinthe Socket Uncaught TypeError: Cannot instantiate an arrow using patch-package
diff --git a/node_modules/@absinthe/socket/src/cancel.js b/node_modules/@absinthe/socket/src/cancel.js
index 1cd731e..75803a4 100644
--- a/node_modules/@absinthe/socket/src/cancel.js
+++ b/node_modules/@absinthe/socket/src/cancel.js
@@ -60,7 +60,7 @@ const cancelActive = (absintheSocket, notifier) =>
* unsubscribing in case it holds a subscription request
*
* @example
- * import * as withAbsintheSocket from "@absinthe/socket";
+ * import * as withAbsintheSocket from "@absinthe/socket/src";