This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# | |
# Author: Nick Zaccardi <[email protected]> | |
# | |
# This script is designed to help release packages to PyPI faster. It tries its | |
# best to walk you through all the steps to release a source packages and a | |
# binary wheel package. | |
# | |
# The script does the following | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import flask | |
import socket | |
import fcntl | |
import struct | |
app = flask.Flask(__name__) | |
# http://stackoverflow.com/questions/24196932/how-can-i-get-the-ip-address-of-eth0-in-python | |
def get_ip_address(ifname): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Uncaught TypeError: Cannot read property 'getAttribute' of undefined | |
at Notification.UIkit._getProps (http://localhost:5000/static/js/bundle.js:12413:25) | |
at Notification.UIkit._initProps (http://localhost:5000/static/js/bundle.js:12348:43) | |
at Notification.UIkit.$mount (http://localhost:5000/static/js/bundle.js:12574:14) | |
at Notification.created (http://localhost:5000/static/js/bundle.js:16966:18) | |
at http://localhost:5000/static/js/bundle.js:12131:66 | |
at Array.forEach (native) | |
at Notification.UIkit._callHook (http://localhost:5000/static/js/bundle.js:12131:22) | |
at Notification.UIkit._init (http://localhost:5000/static/js/bundle.js:12275:14) | |
at new Notification (eval at createClass (http://localhost:5000/static/js/bundle.js:12089:16), <anonymous>:2:47) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Original: https://nixos.wiki/wiki/NixOS_on_ZFS#How_to_install_NixOS_on_a_ZFS_root_filesystem | |
# Make sure to enable EFI support in VB. Settings -> System -> Enable EFI | |
# Add the zfs filesystem to the install environment: | |
nano /etc/nixos/configuration.nix | |
## ---8<-------------------------8<--- | |
boot.supportedFilesystems = [ "zfs" ]; | |
## ---8<-------------------------8<--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------- | |
-- SERVER LEVEL COMMANDS -- | |
--------------------------- | |
-- Create a new template database (we could alter template1 as well). | |
CREATE DATABASE "template2"; | |
-- This avoids possibly droping the template table | |
UPDATE pg_database SET datistemplate = true WHERE datname='template2'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import falcon | |
import sqlalchemy | |
from .middleware import SQLAlchemyMiddleware | |
from .db import session | |
def create_app(config: dict): | |
session.configure(bind=sqlalchemy.create_engine(config.get('DATABASE_URL', 'sqlite://'))) | |
return falcon.API(middleware=[SQLAlchemyMiddleware(session)]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import falcon | |
import falcon.media | |
import falcon.testing | |
class TextHandler(falcon.media.BaseHandler): | |
def serialize(self, media, content_type): | |
return str(media).encode() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
from typing import List, Optional | |
import dataclasses | |
import enum | |
INDENT = ' ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Don't try to be vi compatible | |
set nocompatible | |
" Helps force plugins to load correctly when it is turned back on below | |
filetype off | |
" Plugin Settings | |
let g:clang_library_path='/usr/lib/x86_64-linux-gnu/libclang-6.0.so.1' | |
" Turn on syntax highlighting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# curl https://gist.githubusercontent.com/nZac/e200b656539b0aa311b579e25c258e36/raw > ~/.tmux.conf | |
# Prett Colors! Make sure iTerm2 is setup with "xterm-256color" | |
set -g default-terminal "screen-256color" | |
set -g terminal-overrides "" | |
set -g status-bg '#666666' | |
set -g status-fg '#aaaaaa' | |
set-option -g renumber-windows on | |
set -g update-environment "SSH_AUTH_SOCK" |