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
import os, glob | |
def clean_folder(exts, | |
root, | |
subdir=True, | |
fn='*.'): | |
""" | |
Clears files with extension in exts matching pattern fn in directory | |
(and subdirectories if subdir is set to true) in root | |
""" | |
if subdir == True: |
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
import os, itertools | |
from subprocess import run | |
from multiprocessing.dummy import Pool | |
from functools import partial | |
def set_globs(stexec,scname): | |
global script_name, stata_exec | |
stata_exec = stexec | |
script_name = scname |
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
import os, itertools | |
from subprocess import run | |
from multiprocessing.dummy import Pool | |
from functools import partial | |
def create_command_list(cli_program= " ", invocation=" ", script_name = " ", *args): | |
""" | |
Constructs a list of arguments to be passed to cli_program and/or script name with the invocation specified. to be passed to run_in_parallel below | |
example use: |
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
sudo add-apt-repository ppa:staticfloat/juliareleases | |
sudo apt-get update | |
sudo apt-cache show julia | |
sudo apt-get install julia julia-doc -y | |
julia -E 'Pkg.update()' | |
julia |
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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
Capslock::Ctrl | |
RAlt::Esc |
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
rm(list=ls()) | |
wants <- c('tidyverse','AER','devtools','lfe','glmnet', | |
'data.table','ff','foreach','parallel','stargazer') | |
has <- wants %in% rownames(installed.packages()) | |
if(any(!has)) install.packages(wants[!has],dependencies=TRUE, | |
repos='http://cran.us.r-project.org') | |
sessionInfo() |
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
CONTREPO=https://repo.continuum.io/archive/ | |
# Stepwise filtering of the html at $CONTREPO | |
# Get the topmost line that matches our requirements, extract the file name. | |
ANACONDAURL=$(wget -q -O - $CONTREPO index.html | grep "Anaconda3-" | grep "Linux" | grep "86_64" | head -n 1 | cut -d \" -f 2) | |
wget -O ~/Downloads/anaconda.sh $CONTREPO$ANACONDAURL | |
bash ~/Downloads/anaconda.sh |
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
; ############################ AHK Greek Letters.ahk > | |
; Uses (CTRL & ALT & SHIFT & alphabetic keyboard keys) to send lowercase Greek letters to your text editor | |
+^!a::Send {U+03B1} ; α - alpha | |
+^!b::Send {U+03B2} ; β - beta | |
+^!g::Send {U+03B3} ; γ - gamma | |
+^!c::Send {U+03B3} ; γ - gamma | |
+^!d::Send {U+03B4} ; δ - delta | |
+^!e::Send {U+03B5} ; ε - epislon |
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
// find->find in files | |
// Switch on reg_ex button | |
// Find: | |
^(.*)$ | |
// Where: | |
c:\your_folder\,*.py,*.r,*.sh,*.do,*.md, -*/folder_to_exclude/* | |
// Then click on the find button | |
// On the bottom line of your search result you'll find something like: | |
// 21342 matches in 124 files = your lines of code |
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
youtube-dl --download-archive downloaded.txt --no-post-overwrites -ciwx --audio-format mp3 -o "%(title)s.%(ext)s" youtube_playlist_here |
OlderNewer