Anki is a great open source flashcard app that can be used to learn anything.
This Gist is a full end to end example of how to:
- export Anki decks from Anki
- import Anki decks into MySQL
- edit Anki decks using MySQL
- export Anki decks from MySQL
function stringToNumber(str: string) { | |
str = str.trim() | |
if (/[^\d]/.test(str)) { | |
throw new Error('Deve conter apenas numeros') | |
} | |
return Array.from(str).reverse().reduce((acc, cur, idx) => { | |
let val = (cur.charCodeAt(0) - 48) | |
return acc + (val * 10 ** idx) |
# Copyright 2019 Google LLC | |
# SPDX-License-Identifier: Apache-2.0 | |
package main | |
import ( | |
"fmt" | |
"image" | |
"image/color" | |
"image/draw" | |
"image/gif" |
#!/bin/bash | |
ffmpeg -i input.mov -s 600x400 -pix_fmt rgb8 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > output.gif |
Anki is a great open source flashcard app that can be used to learn anything.
This Gist is a full end to end example of how to:
// Djb2 hash function | |
unsigned long hash(char *str) { | |
unsigned long hash = 5381; | |
int c; | |
while ((c = *str++)) | |
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ | |
return hash % NUM_BUCKETS; | |
} |
from bs4 import BeautifulSoup | |
import requests | |
import re | |
import urllib2 | |
import os | |
import argparse | |
import sys | |
import json | |
# adapted from http://stackoverflow.com/questions/20716842/python-download-images-from-google-image-search |
I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |