export $(cat .env | grep -v ^# | xargs)
This file contains 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 sh | |
sudo apt-get install -y \ | |
git \ | |
g++ \ | |
libgtk-3-dev \ | |
gtk-doc-tools \ | |
gnutls-bin \ | |
valac \ | |
intltool \ |
This file contains 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
from flask import Flask | |
from flask import request | |
from flask import Response | |
from functools import wraps | |
import json | |
app = Flask(__name__) | |
def login_required(f): |
This file contains 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 zsh | |
sleep 10 &! | |
pid=$! # Process Id of the previous running command | |
spin='⠋⠙⠚⠞⠖⠦⠴⠲⠳⠓' | |
i=0 | |
while kill -0 $pid 2>/dev/null; do | |
i=$(((i + 1) % 10)) | |
printf "$fg[magenta]\r${spin:$i:1}" |
This file contains 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
[global_config] | |
suppress_multiple_term_dialog = True | |
[keybindings] | |
[layouts] | |
[[default]] | |
[[[child1]]] | |
parent = window0 | |
type = Terminal | |
[[[window0]]] | |
parent = "" |
This file contains 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
# Base code from: https://iamtrask.github.io/2015/11/15/anyone-can-code-lstm/ | |
import copy | |
import numpy as np | |
np.random.seed(1) | |
def sigmoid(x): | |
output = 1/(1+np.exp(-x)) |
This file contains 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 | |
if [ $# != 2 ] | |
then | |
echo "minify takes exactly 2 arguments ($# given)" | |
exit 1 | |
fi | |
case ${1} in | |
-f) |
This file contains 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
"""IPython startup script to detect and inject VIRTUAL_ENV's site-packages dirs. # noqa | |
IPython can detect virtualenv's path and injects it's site-packages dirs into sys.path. | |
But it can go wrong if IPython's python version differs from VIRTUAL_ENV's. | |
This module fixes it looking for the actual directories. We use only old stdlib | |
resources so it can work with as many Python versions as possible. | |
References: | |
http://stackoverflow.com/a/30650831/443564 |
This file contains 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
# @victorfsf - custom cd v0.1 | |
function cd() { | |
if [ "$1" == "-i" ] | |
then | |
shift 1 | |
builtin cd "$@" | |
return 0 | |
fi | |
builtin cd "$@" && gital |
This file contains 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
# variables | |
dbname=$1 | |
dumpfile=$2 | |
dbbk=$dbname"_bk" | |
# defaults | |
usebk=${3:-false} | |
host=${4:-localhost} | |
port=${5:-5432} | |
username=${6:-postgres} |
NewerOlder