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
# -*- coding: utf-8 -*- | |
__all__ = ('Color', 'ColorStack', 'MoveUp', 'MoveDown', 'MoveColumn', 'Delete', 'Insert', | |
'Erase', 'Save', 'Restore', 'ScrollUp', 'ScrollDown', 'CursorVisible', | |
'COLOR_NONE', 'COLOR_BLACK', 'COLOR_RED', 'COLOR_GREEN', 'COLOR_YELLOW', | |
'COLOR_BLUE', 'COLOR_MAGENTA', 'COLOR_CYAN','COLOR_WHITE', 'COLOR_DEFAULT', | |
'ATTR_NONE', 'ATTR_NORMAL', 'ATTR_BOLD', 'ATTR_ITALIC', 'ATTR_UNDERLINE', | |
'ATTR_BLINK', 'ATTR_NEGATIVE', 'ATTR_FORCE',) | |
#------------------------------------------------------------------------------# |
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
"""Simple echo server | |
pretzel framework: https://github.com/aslpavel/pretzel | |
""" | |
from __future__ import print_function | |
import sys | |
import socket | |
from pretzel.app import app | |
from pretzel.monad import async | |
from pretzel.uniform import BrokenPipeError |
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
"""Cat remote file over ssh | |
pretzel framework: https://github.com/aslpavel/pretzel | |
""" | |
from __future__ import print_function | |
import os | |
import sys | |
from pretzel.app import app | |
from pretzel.monad import async | |
from pretzel.remoting import SSHConnection |
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
# simple bashrc with nice prompt | |
# link: https://gist.github.com/aslpavel/5925739 | |
# install: wget --no-check-certificate -q -O - https://gist.github.com/aslpavel/5925739/download | tar -xzO -f- --strip-components=1 > "$HOME/.bashrc" | |
[ -z "$PS1" ] && return | |
### PROMPT | |
case $TERM in | |
linux|rxvt) | |
col_user=3 |
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
# Simple config.fish with nice prompt (requires patched powerline font) | |
# link: https://gist.github.com/aslpavel/5939845 | |
# install: wget --no-check-certificate -q -O - https://gist.github.com/aslpavel/5939845/download | tar -xzO -f- --strip-components=1 > "$HOME/.config/fish/config.fish" | |
### PROMPT | |
switch "$TERM" | |
case "linux" "rxvt" | |
set _prompt_sep "" | |
set _prompt_col_user 3 | |
set _prompt_col_host 3 |
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 os | |
import re | |
import sys | |
import subprocess | |
def error(msg, code=1): | |
sys.stderr.write('[error] {}\n'.format(msg)) | |
sys.exit(code) |
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
// https://play.rust-lang.org/?gist=6f69dfefc6dd93d941cabb9a1634dcee | |
use std::fmt; | |
use std::iter::FromIterator; | |
use std::rc::Rc; | |
use std::sync::Arc; | |
use std::ops::Deref; | |
// pub trait HKT<U> where U: ?Sized { | |
// type C; // Current type | |
// type T; // Type with C swapped with U |
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
"""Simple implementation of atomatic differentiation | |
""" | |
import math | |
import inspect | |
import numpy as np | |
def apply(fn, *args, **kwargs): | |
return fn(*args, **kwargs) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer