Skip to content

Instantly share code, notes, and snippets.

alexsavio alexsavio

Block or report user

Report or block alexsavio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
alexsavio /
Created Oct 29, 2019 — forked from andreyvit/
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a
alexsavio / script.js
Last active Aug 12, 2019
Google Drive autofill template script
View script.js
// create a menu
function onOpen() {
var menuEntries = [ {name: "Create invoice", functionName: "CreateInv"}];
var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.addMenu("Invoice Generator", menuEntries);
function CreateInv() {
// specify doc template and get values from spread

Signing VirtualBox Kernel Modules

These are the steps I followed enable VirtualBox on my laptop without disabling UEFI Secure Boot. They're nearly identical to the process described on [Øyvind Stegard's blog][blog], save for a few key details. The images here are borrowed from the [Systemtap UEFI Secure Boot Wiki][systemtap].

  1. Install the VirtualBox package (this might be different for your platform).
alexsavio /
Last active Apr 11, 2019
Demo of Ports and Adapters Architecture + Testing for cloud functions in Python
import os
class InMemoryUserRepository(UserRepository):
def __init__(self):
self._items = []
def add(self, user: User) -> User:
def get(self, id: str) -> User:
alexsavio /
Created Jul 8, 2017 — forked from stuartmyles/
A complete example of how to use Amazon Web Services Simple Notification Services from Python. This code uses the boto library to create a topic, wait for a confirmation and then send a success message. Simply plug in your AWS access and secret keys, plus your email and mobile phone number.
# An example of how to use AWS SNS with Python's boto
# By Stuart Myles @smyles
# Inspired by parts of the Ruby SWF SNS tutorial
# And the Python SNS code in and
import boto.sns as sns
import json
alexsavio / styles_fira.less
Last active Jul 1, 2017 — forked from kellyjandrews/styles.less
Fira Code/Operator Atom Less Settings
View styles_fira.less
## Fira Code with Flottflott
atom-text-editor.editor {
.syntax — string.syntax — quoted,
.syntax — string.syntax — regexp {
-webkit-font-feature-settings: “liga” off, “calt” off;
.syntax — source.syntax — js.syntax — jsx > .syntax — keyword.syntax — control.syntax — flow.syntax — js,
.syntax — storage, .syntax — type .syntax — function {
vertical-align: baseline;
View gist:a4d3225895b574dd7554b3270a1f8cdd
### Keybase proof
I hereby claim:
* I am alexsavio on github.
* I am alexsavio ( on keybase.
* I have a public key whose fingerprint is 85F7 B4AC 2719 E0E6 C537 8E06 62A4 1CC0 45A2 9DF7
To claim this, I am signing this object:
#List unique values in a DataFrame column
#Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
#Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(value_list)]
alexsavio /
Created Sep 12, 2015
IPython notebook styles
# based on
# run this in a notebook
import os
import os.path as op
import subprocess
import urllib.request
theme_names = ['3024-dark',
alexsavio /
Last active Sep 12, 2015 — forked from abhiomkar/
Python Logging Cheatsheet
import logging
# prints to stdout
FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
log = logging.getLogger(__file__)
# prints log to stdout and also saves to specified log file
log = logging.getLogger('my_logfile')
You can’t perform that action at this time.