Skip to content

Instantly share code, notes, and snippets.

Daniele Faraglia joke2k

Block or report user

Report or block joke2k

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View remmina-backup.py
import base64
from Crypto.Cipher import DES3
import re
import os
passwords = []
def get_secret():
global secret
@joke2k
joke2k / unicode_emojis_to_faker_provider.py
Last active Jun 26, 2018
Script to extract emojis from unicode.org and create faker provider. [requires: requests-html]
View unicode_emojis_to_faker_provider.py
import sys
from pprint import pformat
from requests_html import HTMLSession
session = HTMLSession()
url = 'https://unicode.org/emoji/charts/emoji-list.html'
r = session.get(url)
@joke2k
joke2k / get-browser-language.php
Last active Jan 29, 2019 — forked from LucaRosaldi/get-browser-language.php
PHP: Detect Browser Language
View get-browser-language.php
<?php
/**
* Get browser language, given an array of avalaible languages.
*
* @param [array] $availableLanguages Avalaible languages for the site
* @param [string] $default Default language for the site
* @return [string] Language code/prefix
*/
function get_browser_language( $available = [], $default = 'en' ) {
if ( isset( $_SERVER[ 'HTTP_ACCEPT_LANGUAGE' ] ) ) {
@joke2k
joke2k / settings.py
Created Jun 5, 2018
standard django settings VS django-environ
View settings.py
import os
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'database',
'USER': 'user',
'PASSWORD': 'githubbedpassword',
'HOST': '127.0.0.1',
View keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@joke2k
joke2k / TranslateSerializer
Created Sep 9, 2014
Django Rest Framework Translated
View TranslateSerializer
# https://groups.google.com/forum/#!topic/django-rest-framework/WTZ0H6dyJe4
class TranslateSerializer(serializers.ModelSerializer):
def __init__(self, *args, **kwargs):
super(TranslateSerializer, self).__init__(*args, **kwargs)
self.translate_fields = getattr(self.Meta, 'translate_fields', ())
if kwargs.get('context', None):
self.lang = utils.get_request_language(kwargs['context'].get('request', None))
def to_native(self, obj):
View gist:3539e9251383b53af4a0
Verifying myself: My Bitcoin username is +joke2k. https://onename.io/joke2k
You can’t perform that action at this time.