Skip to content

Instantly share code, notes, and snippets.


Elias Dorneles eliasdorneles

View GitHub Profile
lmakarov / lambda-basic-auth.js
Created August 30, 2017 19:15
Basic HTTP Authentication for CloudFront with Lambda@Edge
View lambda-basic-auth.js
'use strict';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Configure authentication
const authUser = 'user';
const authPass = 'pass';
import toga
from collections import namedtuple
# Structure of the main data source of the tree
GRADES = namedtuple('Grades', 'cl grade')
class TreeStructure:
def __init__(self):
# Data source of the tree = (
dvdbng /
Last active December 27, 2022 00:18
Run vim in heroku updated 2017
mkdir ~/vim
cd ~/vim
# Staically linked vim version compiled from
# Compiled on Jul 20 2017
curl '' | tar -xz
export VIMRUNTIME="$HOME/vim/runtime"
export PATH="$HOME/vim:$PATH"
cd -
narate /
Last active January 18, 2023 13:46
Create Wi-Fi Hotspot on Linux using nmcli

Create a Wi-Fi hotspot on Linux using nmcli

Original post :

nmcli con add type wifi ifname wlan0 con-name Hostspot autoconnect yes ssid Hostspot
nmcli con modify Hostspot 802-11-wireless.mode ap bg ipv4.method shared
nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk
nmcli con modify Hostspot wifi-sec.psk "veryveryhardpassword1234"
eliasdorneles /
Last active February 28, 2018 00:53
A hack to simulate a REPL for VOC
# For arrow-keys history and other cmdline goodies, install rlwrap and replace
# the first line by: #!/usr/bin/rlwrap bash
# This is a hack to simulate a REPL for VOC (
# Behind the scenes, every time you try a new expression it appends it to a temporary
# file, recompiles it and re-runs it, omitting the previous output.
# This has the caveat that if some expression you enter raises an exception,
# This script assumes you're using the directory layout described in the
# documentation at:
set -e
set -x
abort() {
echo "$*"; exit 1;
geier /
Created May 3, 2016 15:41
minimal urwid example (ListWalker)
import urwid
class SelectableText(urwid.Text):
def selectable(self):
return True
def keypress(self, size, key):
return key
content = urwid.SimpleListWalker([
eliasdorneles /
Last active November 26, 2015 09:07
For Those Times When You Just Want a Button
#!/usr/bin/env python
# -*- coding: utf-8 -*-
For those times when you just want a button.
Run and notice the new icon in your notifications area.
Inspired by: