Skip to content

Instantly share code, notes, and snippets.

@mattrasband
mattrasband / server.py
Created April 17, 2016 21:58
Google OAuth with Aiohttp
#!/usr/bin/env python3
import aiohttp
from aiohttp import web
from urllib.parse import urlencode
GOOGLE_SECRET = '<google secret>'
GOOGLE_CLIENT_ID = '<google client id>'
async def google_oauthcallback(request):
@binaerbaum
binaerbaum / arch-linux-install
Last active April 6, 2022 03:16 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI NVMe system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swiss-french keymap
@chrissimpkins
chrissimpkins / gist:5bf5686bae86b8129bee
Last active March 6, 2023 00:10
Atom Editor Cheat Sheet: macOS

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
import hashlib
import sys
# Our function to get the MD5 hash of a string
def getMD5Hash(textToHash=None):
return hashlib.md5(textToHash).hexdigest()
f = open(sys.argv[1], 'rb')
s = f.read()
f.close()
@mattdesl
mattdesl / ShaderLesson1LibGDX.java
Last active May 8, 2020 16:40
ShaderLesson1 Ported to LibGDX
package atmos.tool2d;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;