Skip to content

Instantly share code, notes, and snippets.

Jason K. Moore moorepants

Block or report user

Report or block moorepants

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ximeg
ximeg / ThresholdingAlgo.py
Created Apr 20, 2017
Python implementation of smoothed z-score algorithm from http://stackoverflow.com/a/22640362/6029703
View ThresholdingAlgo.py
#!/usr/bin/env python
# Implementation of algorithm from http://stackoverflow.com/a/22640362/6029703
import numpy as np
import pylab
def thresholding_algo(y, lag, threshold, influence):
signals = np.zeros(len(y))
filteredY = np.array(y)
avgFilter = [0]*len(y)
stdFilter = [0]*len(y)
@bishboria
bishboria / springer-free-maths-books.md
Last active Apr 7, 2020
Springer made a bunch of books available for free, these were the direct links
View conda virtualenv bashrc
# .bashrc
################################################################################
# python environment control
################################################################################
export PYTHON_ENV=""
function entervirtualenv
{
if type virtualenvwrapper.sh >/dev/null 2>&1; then
@TimBozeman
TimBozeman / superH
Created May 19, 2014
A script you can bind to a hotkey that toggles the Hamster Time Tracker window
View superH
#!/bin/bash
# @File Switch between current window and Hamster Time Tracker
# get current window
hamster="Time Tracker"
currentWindow=$(xprop -id $(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2) _NET_WM_NAME|cut -d'"' -f2)
if [ "${currentWindow}" != "$hamster" ]
# write the title of the current window to a file and switch to hamster
then echo "${currentWindow}" > /tmp/hamster.dat && wmctrl -Fa "$hamster"
# read window temp file and switch to it
@sloria
sloria / bobp-python.md
Created Oct 16, 2013
A "Best of the Best Practices" (BOBP) guide to developing in Python.
View bobp-python.md

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@kwmsmith
kwmsmith / pairwise_cython.pyx
Last active Dec 1, 2019
Numba vs. Cython: Parallel Cython with OMP
View pairwise_cython.pyx
#cython:boundscheck=False
#cython:wraparound=False
import numpy as np
from cython.parallel cimport prange
from libc.math cimport sqrt
cdef inline double dotp(int i, int j, int N, double[:, ::1] X) nogil:
cdef:
int k
View example.pyx
import numpy as np
import scipy.linalg.blas
cdef extern from "f2pyptr.h":
void *f2py_pointer(object) except NULL
ctypedef int dgemm_t(
char *transa, char *transb,
int *m, int *n, int *k,
double *alpha,
@stefanschmidt
stefanschmidt / remove-annotations.sh
Last active Mar 26, 2020
Remove all annotations from a PDF document
View remove-annotations.sh
pdftk original.pdf output uncompressed.pdf uncompress
LANG=C sed -n '/^\/Annots/!p' uncompressed.pdf > stripped.pdf
pdftk stripped.pdf output final.pdf compress
@iamatypeofwalrus
iamatypeofwalrus / roll_ipython_in_aws.md
Last active Mar 9, 2020
Create an iPython HTML Notebook on Amazon's AWS Free Tier from scratch.
View roll_ipython_in_aws.md

What

Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.

What are we using? What do you need?

  • An active AWS account. First time sign-ups are eligible for the free tier for a year
  • One Micro Tier EC2 Instance
  • With AWS we will use the stock Ubuntu Server AMI and customize it.
  • Anaconda for Python.
  • Coffee/Beer/Time
@ezietsman
ezietsman / build_deeming.sh
Last active Feb 7, 2017
Python, Cython, Fortran f2py and OpenCL versions of a Deeming periodogram
View build_deeming.sh
#!/bin/bash
f2py -c -m deeming periodogram.f90 -lgomp
f2py -c -m deemingomp periodogram.f90 --f90flags="-fopenmp " -lgomp
You can’t perform that action at this time.