Skip to content

Instantly share code, notes, and snippets.

View wetneb's full-sized avatar

Antonin Delpeuch wetneb

View GitHub Profile
@mvolz
mvolz / ISOToWikimediaLanguageCodes.json
Last active February 28, 2019 12:26
JSON file with the ISO / IETF language tags as keys and the values are Wikimedia Language Codes.
{
"aa": "aa",
"ab": "ab",
"abe": "abe",
"ace": "ace",
"ady": "ady",
"aeb-Arab": "aeb-arab",
"af": "af",
"ak": "ak",
"aln": "aln",
{
"version": "1.0.2", // version of the manifest format
"mediawiki": {
"name": "Wikidata",
"root": "https://www.wikidata.org/wiki/",
"main_page": "https://www.wikidata.org/wiki/Wikidata:Main_Page",
"api": "https://www.wikidata.org/w/api.php"
"namespace": {
"item": "Item",
@DamianZaremba
DamianZaremba / settings.py
Last active March 9, 2018 14:50
Django social auth fix for Specified key was too long; max key length is 767 bytes
# Shrink specific columns down, so the key combination for the constraints
# aren't larger than the max legnth, when not using innodb_large_prefix.
# Length may require tweaking depending on application requirements
SOCIAL_AUTH_UID_LENGTH = 190
SOCIAL_AUTH_NONCE_SERVER_URL_LENGTH = 190
SOCIAL_AUTH_ASSOCIATION_SERVER_URL_LENGTH = 190
SOCIAL_AUTH_ASSOCIATION_HANDLE_LENGTH = 190
SOCIAL_AUTH_EMAIL_LENGTH = 190
@XuefengWu
XuefengWu / KryoFile
Last active January 20, 2020 20:30
Spark RDD save Object as Kryo file
package spark
import java.io._
import java.util.zip.Deflater
import com.esotericsoftware.kryo.io.{Input => KryoInput, Output => KryoOutput}
import com.esotericsoftware.kryo.serializers.DeflateSerializer
import com.twitter.chill.{AllScalaRegistrar, EmptyScalaKryoInstantiator}
import org.apache.hadoop.io.compress.DeflateCodec
@joshmarshall
joshmarshall / tornado_temp_json_post.py
Created March 15, 2011 02:43
JSON to Arguments POST in Tornado
import tornado.ioloop
import tornado.web
import tornado.httpserver
import tornado.httputil
import json
class MainHandler(tornado.web.RequestHandler):
def post(self):
# do something useful
name = self.get_argument('foo')