Skip to content

Instantly share code, notes, and snippets.

@qheuristics
qheuristics / peakdetect.py
Created November 10, 2013 08:45 — forked from sixtenbe/analytic_wfm.py
returns the index and value of the local maxima and minima in two separate lists
import numpy as np
from math import pi, log
import pylab
from scipy import fft, ifft
from scipy.optimize import curve_fit
i = 10000
x = np.linspace(0, 3.5 * pi, i)
y = (0.3*np.sin(x) + np.sin(1.3 * x) + 0.9 * np.sin(4.2 * x) + 0.06 *
np.random.randn(i))
@qheuristics
qheuristics / conda_cheat
Last active November 13, 2020 12:22
conda cheatsheet
to create a new environment
conda create -n mynewenviron package1 package2 etc
conda create -n newenv --clone ~anaconda
to remove an environment
conda remove -n myenvirontoremove --all
always start with
@qheuristics
qheuristics / remote_task_mngr
Created May 7, 2014 23:26
how to display task manager in remote desktop window
Ctrl + Alt + delete on local session
Ctrl + Shift + Esc on remote session
@qheuristics
qheuristics / home_dir
Created May 30, 2014 07:27
home directory location
Where a user's home directory is located varies from platform to platform and among the users on a single computer. But the actual location of the home directory is available through special environment variables:
Unix/Linux
$HOME
Windows
%USERPROFILE%
Cygwin
$USERPROFILE
In order to find out where these environment variables actually point to, do the following:
on Unix/Linux, open a terminal and type the following command
http://solovyov.net/en/2011/basic-sqlalchemy/

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh root@123.123.123.123

Add ssh fingerprint and enter password provided in email

@qheuristics
qheuristics / gist:756d28dd9c3c1fdbe04a
Created November 10, 2015 21:31 — forked from seanmcn/gist:62a021a765ad4f8e593b
The Perfect Web Server - Nginx, Ajenti, Ubuntu
#Insall Ajenti
apt-get update
wget http://repo.ajenti.org/debian/key -O- | apt-key add -
echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list
apt-get update
apt-get install ajenti
service ajenti restart
# Uninstall Apache2
sudo apt-get autoremove && sudo apt-get remove apache2*
@qheuristics
qheuristics / useful_pandas_snippets.py
Created February 28, 2016 17:40 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
#List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
#Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
#Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(value_list)]
@qheuristics
qheuristics / bootstrap_cmdline.py
Created February 15, 2018 20:32 — forked from elmotec/bootstrap_cmdline.py
Minimal python program with logging and argparse.
#!/usr/bin/env python
# encoding: utf-8
"""Minimal python commad line."""
import sys
import argparse
import logging
@qheuristics
qheuristics / acud_console_demo.ipynb
Last active September 4, 2018 15:47
acud console session
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.