Skip to content

Instantly share code, notes, and snippets.

View MarcusXavierr's full-sized avatar
🎯
Focusing

Marcus Xavier MarcusXavierr

🎯
Focusing
View GitHub Profile
@Deleplace
Deleplace / signdance.go
Last active June 20, 2023 15:29
A web server that generates dancing gopher GIFs
# Copyright 2019 Google LLC
# SPDX-License-Identifier: Apache-2.0
package main
import (
"fmt"
"image"
"image/color"
"image/draw"
"image/gif"
@ubmit
ubmit / convert-mov-to-gif.sh
Last active November 19, 2022 11:38
🎥 convert a .mov file to .gif
#!/bin/bash
ffmpeg -i input.mov -s 600x400 -pix_fmt rgb8 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > output.gif
@androidfred
androidfred / advanced_anki_deck_editing.md
Last active April 27, 2024 04:25
Advanced Anki deck editing made simple (ish)

Advanced Anki deck editing made simple (ish)

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
// 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;
}
@genekogan
genekogan / scrapeImages.py
Created February 22, 2017 11:49
scraping full size images from Google Images
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
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active July 8, 2024 06:24
Using multiple github accounts with ssh keys

Problem

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).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# 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