Skip to content

Instantly share code, notes, and snippets.

import numpy as np
import scipy, scipy.signal
def savitzky_golay( y, window_size, order, deriv = 0 ):
r"""Smooth (and optionally differentiate) data with a Savitzky-Golay filter.
The Savitzky-Golay filter removes high frequency noise from data.
It has the advantage of preserving the original shape and
features of the signal better than other types of filtering
approaches, such as moving averages techhniques.
Parameters
import platform
import usb.core
import usb.backend.libusb1
from ctypes import c_void_p
from pyftdi.ftdi import Ftdi
backend = usb.backend.libusb1.get_backend()
if backend and platform.system() == "Windows":
backend.lib.libusb_set_usbdk.argtypes = [c_void_p]
backend.lib.libusb_set_usbdk(backend.ctx)
@RyanHope
RyanHope / LoL.R
Last active July 12, 2020 12:18
R Riot LoL
require(RCurl)
require(rjson)
require(stringr)
require(rgexf)
getRiotKey <- function() {
key <- getOption("riot.key")
if (is.null(key))
stop("getOption(\"riot.key\") returned NULL.")
key
#!/usr/bin/env python
"""
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
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, and/or sell
copies of the Software, and to permit persons to whom the Software is
@RyanHope
RyanHope / badtab.py
Created October 24, 2018 14:46
wxPython broken notebook on Linux/Gtk3
import wx
class Tab1(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
self.l = wx.StaticText(self, label="Text")
self.sizer = wx.GridBagSizer(0,0)
self.sizer.Add(self.l, pos=(0,0))
self.SetSizer(self.sizer)
#!/usr/bin/env python
"""
Parse a SF logfile and BDF file and generate EEGLAB compat event file
"""
from __future__ import print_function, division
import sys, os
import csv
@RyanHope
RyanHope / msys2_theano.Rmd
Last active January 29, 2017 18:09
MSYS2 Theano Windows 10 64bit
MSYS2 Theano Windows 10 64bit Setup Notes
==========================================
Update MSYS2, run until no updates
-------------------------------------
```
pacman -Syuu
```
Install GCC
2016-07-27 11:15:35,214 [ pgoapi] [ INFO] Create new request...
2016-07-27 11:15:35,216 [ pgoapi] [ INFO] Adding 'ENCOUNTER' to RPC request including arguments
2016-07-27 11:15:35,216 [ pgoapi] [DEBUG] Arguments of 'ENCOUNTER':
{'player_longitude': -79.99990432564914, 'spawn_point_id': u'8834f156fb7', 'encounter_id': 5752263169355807389L, 'player_latitude': 40.4409188}2016-07-27 11:15:35,217 [ pgoapi] [ INFO] Execution of RPC
2016-07-27 11:15:35,217 [ rpc_api] [DEBUG] Generating main RPC request...
2016-07-27 11:15:35,219 [ rpc_api] [DEBUG] Generating sub RPC requests...
2016-07-27 11:15:35,219 [ rpc_api] [DEBUG] Subrequest class: POGOProtos.Networking.Requests.Messages_pb2.EncounterMessage
2016-07-27 11:15:35,220 [ rpc_api] [DEBUG] Generated protobuf request:
status_code: 2
request_id: 8145806132888207460
@RyanHope
RyanHope / httpRequest.py
Created July 25, 2016 23:33 — forked from lukemarsden/httpRequest.py
Simple function to do an HTTP POST using Twisted Agent
from twisted.web.iweb import IBodyProducer
from twisted.internet import defer
from twisted.web.client import Agent
from twisted.web.http_headers import Headers
import urllib
class StringProducer(object):
implements(IBodyProducer)
def __init__(self, body):
move_1 move_2 name pokemon_id individual_stamina power_quotient individual_defense stamina individual_attack cp nickname
------------- --------------- ---------- ------------ -------------------- ---------------- -------------------- --------- ------------------- ---- ----------
Ember Heat Wave Flareon 136 15 91 11 77 15 1195
Zen Headbutt Psybeam Psyduck 54 11 89 14 55 15 434
Pound Psyshock Drowzee 96 13 89 12 61 15 362
Poison Sting Horn Attack Nidorino 33 13 89 14 76 13 689
Confusion Psychic Hypno 97