Skip to content

Instantly share code, notes, and snippets.

@Yoone
Yoone / django_mysql_dump.sh
Created March 4, 2017 19:50
Dump a Django project's MySQL database
#!/usr/bin/env bash
set -euo pipefail
# Example usage in a crontab:
# 0 */6 * * * /path/to/djangoproject/django_mysql_dump.sh -d ~/mydumps
DEBUG=0
PYTHON_PATH=$(dirname "$0")
SETTINGS=djangoproject.settings
@Yoone
Yoone / scala_pretty_obj.py
Created February 25, 2018 05:01
Pretty print Scala complex object structures printed by specs2
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Yoann Bentz'
__version__ = '1.0'
__email__ = 'yoann@yoone.eu'
import os
import sys
import tempfile
@Yoone
Yoone / cpu-arch.c
Created February 25, 2018 05:12
Find out a machine's CPU architecture in C
#include <stdio.h>
int main(void)
{
/*
* AMD64
*/
#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64)
printf("AMD64\n");
@Yoone
Yoone / endianness.c
Created February 25, 2018 05:14
Test endianness in C
#include <stdio.h>
#include <stdint.h>
static inline uint8_t is_big_endian(void)
{
const uint16_t endian = 256;
return *(const uint8_t *)&endian;
}
int main(void)
@Yoone
Yoone / keybase.md
Created November 26, 2018 01:22
keybase.md

Keybase proof

I hereby claim:

  • I am yoone on github.
  • I am yooone (https://keybase.io/yooone) on keybase.
  • I have a public key ASD0gN4QQFHy7KPFJh4ayVY0Zu0jVilmogjK_xK6_IqhGwo

To claim this, I am signing this object: