Skip to content

Instantly share code, notes, and snippets.

View jathanasiou's full-sized avatar

John Athanasiou jathanasiou

  • Cloudsoft
  • Edinburgh, Scotland, UK
View GitHub Profile
@btfak
btfak / useHexo.md
Created May 26, 2016 09:41
How to use Hexo and deploy to GitHub Pages
@m-ou-se
m-ou-se / replace-debian-with-arch.txt
Last active January 30, 2025 05:03
Instructions to replace a live Debian installation with Arch
# Download latest archlinux bootstrap package, see https://www.archlinux.org/download/
wget 'ftp://ftp.nluug.nl/pub/os/Linux/distr/archlinux/iso/latest/archlinux-bootstrap-*-x86_64.tar.gz'
# Make sure you'll have enough entropy for pacman-key later.
apt-get install haveged
# Install the arch bootstrap image in a tmpfs.
mount -t tmpfs none /mnt
cd /mnt
tar xvf ~/archlinux-bootstrap-*-x86_64.tar.gz --strip-components=1
@gaearon
gaearon / slim-redux.js
Last active December 3, 2024 06:34
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@dannguyen
dannguyen / quickie-google-geocode.py
Last active November 15, 2017 21:06
Quick command-line script in Python 3 to geocode a location using Google Maps Geocoding API
#!/usr/bin/env python3
#
# A Python 3.x script designed for command-line operation:
# Given a location string, passes it to Google's Geocoding API and prints to stdout: lat, lng,
# level of accuracy, and formatted address, as a single delimited line and, optionally, the raw JSON
# This is one in a series of mundane programming examples:
# - srccon.org/sessions/#proposal-106215
# - https://docs.google.com/spreadsheets/d/1oaUNiWOyuTmxr0hVgx32vr5XN8E4MEb_2FD56BE6mZA/edit?usp=drive_web
#
# Documentation of Google Maps API
@soarez
soarez / ca.md
Last active April 15, 2025 12:46
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@branneman
branneman / better-nodejs-require-paths.md
Last active April 11, 2025 10:39
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions