Skip to content

Instantly share code, notes, and snippets.

@Altoidnerd
Altoidnerd / load_ct_data.py
Last active January 19, 2023 01:30
load data
import pandas as pd
import os
from pprint import pprint
############# constants #########
# YOU MUST MODIFY data_dir #
#################################
data_dir = '/Users/allen/Developer/'
infile = 'cointracker_v_jh.xlsx'
path = os.path.join(data_dir, infile)
names = ['cointracker','send-receive','buy-sell','trade','totals_send-receive','totals_buy-sell','totals_trade']
e='echo -e'
or col in $cols; do
# First we get the column we want to process with an SQL query
# sed 1d supresses the column name
$e "$(date):\tgetting column $col ... " >> $logfile
column=$($sqlget "select \`$col\` from \`$db\`.\`$table\`"| sed 1d);
@Altoidnerd
Altoidnerd / piticker.py
Last active July 9, 2017 19:52
ticker for predictit
#!/usr/bin/env python3
#
# Get a market summary given a market key string such
# as "RDTS.071217" as a command line arguement, or
# change default_key_string to run without an argument.
#
# Example:
#
# user@host:~ > python3 ticker.py RDTS.071217
#
@Altoidnerd
Altoidnerd / iterate_cutoff_energies.bash
Created April 29, 2016 02:25
Script to use Quantum Espresso in a range of cutoff energies.
#!/bin/bash
#
#
# Copyright (c) 2016 altoidnerd
#################################################################################
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
# to deal in the Software without restriction, including without limitation #
# the rights to use, copy, modify, merge, publish, distribute, sublicense, #
@Altoidnerd
Altoidnerd / nqr_parser.py
Last active April 29, 2016 02:29
Parses (kinda) output of gipaw.x for job 'efg' getting NQR frequencies(for 14N and 35Cl only).
#!/usr/bin/env python3
import numpy as np
import sys
#################################
#################################
## ####
## working version! tested! ####
## ####
@Altoidnerd
Altoidnerd / mancat.py
Created January 27, 2016 12:00
A tribute ...
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
class PrintColors:
DIR = '\033[96m'
HEADER = '\033[95m'
OKBLUE = '\033[94m'
WARNING = '\033[93m'
OKGREEN = '\033[92m'
FAIL = '\033[91m'
@Altoidnerd
Altoidnerd / catman.py
Created January 27, 2016 11:33
instant classic
#!/usr/bin/env python
class PrintColors:
DIR = '\033[96m'
HEADER = '\033[95m'
OKBLUE = '\033[94m'
WARNING = '\033[93m'
OKGREEN = '\033[92m'
FAIL = '\033[91m'
bDIR = '\033[1;96m'
@Altoidnerd
Altoidnerd / shellista.py
Created January 25, 2016 20:02 — forked from pudquick/shellista.py
Advanced shell for Pythonista
import os, cmd, sys, re, glob, os.path, shutil, zipfile, tarfile, gzip
# Credits
#
# The python code here was written by pudquick@github
#
# License
#
# This code is released under a standard MIT license.
#
@Altoidnerd
Altoidnerd / beep.py
Created December 4, 2015 04:26
python-pyaudio example for beatrice
import pyaudio
import numpy as np
def play_shit(samples, fs=44100, volume=0.5):
p = pyaudio.PyAudio()
stream = p.open(format=pyaudio.paFloat32,
channels=1,
rate=fs,
output=True)
@Altoidnerd
Altoidnerd / install_fruitywatch.sh
Created July 30, 2015 16:00
fruitywatch installer
cd && echo 'watch -tcpn.5 '\''figlet -f big -W "$(date +%l:%M:%S)"|toilet -f term --gay'\' > fruitywatch && chmod +x fruitywatch; mv ./fruitywatch /usr/local/bin && fruitywatch