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 python | |
import sys | |
import pkgutil | |
import os | |
if len(sys.argv) != 2: | |
print("Usage: sublime_load.py <package-name>") | |
else: | |
package = sys.argv[1] | |
loader = pkgutil.find_loader(package) |
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
%load_ext autoreload | |
%aimport module_to_be_reload # Select modules to be reloaded | |
%autoreload 1 # Set that we want only the listed modules |
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
def ask | |
print "Do you want to continue? (y/N) " | |
answer = STDIN.gets.strip.downcase | |
if answer != "y" | |
return false | |
end | |
return true | |
end | |
def get_branch |
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
add2virtualenv /usr/lib64/python2.7/plat-linux2/ |
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
def my_loadtxt(fname, columns=-1, delimiter=',', dtype='float32'): | |
with open(fname) as f: | |
if columns == -1: | |
line = f.readline() | |
columns = np.fromstring(line, sep=delimiter).shape[0] | |
f.seek(0) | |
rows = 0 | |
for line in f: | |
rows += 1 | |
f.seek(0) |
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 python | |
import pydons | |
import sys | |
def _wrap_with(code): | |
def inner(text, bold=True): | |
c = code | |
if bold: | |
c = "1;%s" % c | |
return "\033[%sm%s\033[m" % (c, text) # '\033[m' |
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
#!ruby | |
# Simple script to change all the file names in current directory to small case | |
require 'fileutils' | |
Dir.foreach(".") do |fn| | |
n = fn.downcase | |
if n != fn | |
FileUtils.mv(fn, n) | |
end |
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
function anaconda { | |
# Added by Anaconda 2.1.0 installer | |
export PATH="/opt/anaconda/bin:$PATH" | |
# Fix to use pure anaconda Qt | |
export QT_PLUGIN_PATH="/opt/anaconda/plugins" | |
} | |
function workon { | |
echo "Initializing anaconda..." |
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 | |
# pip install runipy | |
find . -maxdepth 1 -name "*ipynb" -print0 | xargs -0 -n1 runipy |
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
Sub Normostrany() | |
Dim Title As String | |
Dim CharCount As Long | |
Dim Message As String | |
Dim Pages As Double | |
CharCount = ActiveDocument.BuiltInDocumentProperties("Number of characters (with spaces)") | |
Pages = CharCount / 1800# | |
Title = "Počet normostran" |
OlderNewer