Skip to content

Instantly share code, notes, and snippets.

View korymath's full-sized avatar

Kory korymath

View GitHub Profile
@korymath
korymath / gist:7553926
Created November 19, 2013 22:45
Eventbrite / WordPress Integration in PHP, handles repeating events, and removes past events.
<?php
// load the API Client library
$authentication_tokens = array('app_key' => 'APPKEY',
'user_key' => 'USERKEY');
$eb_client = new Eventbrite( $authentication_tokens );
$events = $eb_client->user_list_events(array('event_statuses'=>'live,started','display'=>'repeat_schedule'));
$repeat_events = array();
foreach ($events->events as $event) {
if ( 'yes' === $event->event->repeats ) {
@korymath
korymath / single-beer-guide.php
Created November 20, 2013 21:58
Pagination of Custom Post Type in WordPress
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'paged' => $paged,
'post_type' => 'review-single',
'category_name' => types_render_field("category-slug-to-pull", array()),
'posts_per_page' => '10'
));
@korymath
korymath / videos-archive.php
Created November 20, 2013 23:03
Videos Pagination Custom Post Type
<?php
/*
Template Name: Videos
*/
get_template_part( 'header' ); ?>
<div class="container">
<div class="header">
<a href="<?php bloginfo('url'); ?>"><div class="logo"></div></a>
@korymath
korymath / Ideal Notes
Created November 24, 2013 00:10
Calling Ideal is Relatively Easy
Output = IDEALv3(MultiEchoImage,TEs,[-220,0.75;-244,0.1;-164,0.08;43,0.06],Mode,InitialGuess);
Ray's description/help for IDEALv3 should explain everything, but simply:
MultiEchoImage = X,Y,nEchos
TEs = array of echo times (in ms)
[-220,0.75;-244,0.1;-164,0.08;43,0.06] is the fat profile IDEAL will use
Mode is whether you set an initial phase guess to 0 (Mode = 0), provide an initial guess (Mode = 1) but let IDEAL come to potentially another solution, or 'clamp' to the provided 'initial guess' (Mode = 2)
Initial guess is, as I provide it, the output (X,Y,nEchos) from MRIBackgroundCorrect_new_auto (data_background_r output), when I call it:
[data_corrected_r,data_background_r]=MRIBackgroundCorrect_new_auto(im31/(2*pi*delTE*10^-3),mask,3);
@korymath
korymath / gist:1b94fe86e2df78746985
Created June 16, 2014 18:05
beerFinder javascript
beerfinder = {
map: null,
markers: [],
windows: [],
masterBeerList:[],
defaults: {
lat: 51.045925999999990000,
long: -114.057959999999980000,
style:
@korymath
korymath / gist:74102c2632006d72990c
Created June 16, 2014 18:08
Beer Definition Array
var beer_list = {
'beers': [
{
'beer': {
'ID': 9,
'name': 'Alberta Crude',
'icon': ''
}
},
@korymath
korymath / parallel.py
Last active August 29, 2015 14:25 — forked from alertor/parallel.py
from joblib import Parallel, delayed
import multiprocessing
inputs = range(100000)
def processInput(i):
return i * i
num_cores = multiprocessing.cpu_count()
print str(num_cores)
@korymath
korymath / nao-guy
Last active May 11, 2016 20:58
running nao test simulations
Run the following in different tabs in terminal
MDP Constant
/usr/bin/python blueberry_move_and_emg.py -t 40000 -s 0.02 -p 1000 -a 1 -r MDP -o 49234 -g 0.1 -u 0.05 -mean 0.005 -std 1.0
MDP Relative
/usr/bin/python blueberry_move_and_emg.py -t 40000 -s 0.02 -p 1000 -a 1 -r MDP -m relative -o 49234 -g 0.1 -u 0.05 -mean 0.005 -std 1.0
Human
/usr/bin/python blueberry_move_and_emg.py -t 40000 -s 0.02 -p 1000 -a 1 -r Human -o 49234 -g 0.1 -u 0.05 -mean 0.005 -std 1.0
# Basic Random Cart Pole Performance
run the basic cart pole code in the tutorial
import gym
env = gym.make('Reacher-v1')
env.reset()
env.render()
env.monitor.start('/tmp/reacher-1', force=True)
for i_episode in xrange(101):
observation = env.reset()
for t in xrange(100):
env.render()