Skip to content

Instantly share code, notes, and snippets.

Avatar

Sergei Vishnikin armicron

View GitHub Profile
@armicron
armicron / create_table.py
Last active Oct 24, 2019
boto3 dynamodb, create table
View create_table.py
import boto3
"""
very slow
docker run -d -p 8000:8000 deangiberson/aws-dynamodb-local
very fast
docker run -d -p 8000:8000 dwmkerr/dynamodb -inMemory
"""
@armicron
armicron / hello_world_into_file.asm
Created Oct 10, 2016
NASM x86_64 open file and write 'Hello world'
View hello_world_into_file.asm
section .text
global _start ;must be declared for linker (ld)
_start: ;tell linker entry point
mov rdi, filename
mov rsi, 0102o ;O_CREAT, man open
mov rdx, 0666o ;umode_t
mov rax, 2
syscall
View gist:cf47df570014da6ce6f3
1) (Backward compatible) Django 1.8 get_current_site RequestSite support
https://github.com/pennersr/django-allauth/commit/1a25ea96efcb969945df53be220bb65d75ef50db
2) simplejson compatibility
try:
from django.utils import simplejson
except ImportError:
import json as simplejson
3) try:
from django.contrib.sites.requests import RequestSite
except ImportError:
You can’t perform that action at this time.