Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Kory korymath

💭
I may be slow to respond.
View GitHub Profile
@korymath
korymath / gist:7553926
Created Nov 19, 2013
Eventbrite / WordPress Integration in PHP, handles repeating events, and removes past events.
View gist:7553926
<?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 Nov 20, 2013
Pagination of Custom Post Type in WordPress
View single-beer-guide.php
<?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 Nov 20, 2013
Videos Pagination Custom Post Type
View videos-archive.php
<?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 Nov 24, 2013
Calling Ideal is Relatively Easy
View Ideal Notes
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);
View gist:1b94fe86e2df78746985
beerfinder = {
map: null,
markers: [],
windows: [],
masterBeerList:[],
defaults: {
lat: 51.045925999999990000,
long: -114.057959999999980000,
style:
View gist:74102c2632006d72990c
var beer_list = {
'beers': [
{
'beer': {
'ID': 9,
'name': 'Alberta Crude',
'icon': ''
}
},
View 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
running nao test simulations
View nao-guy
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
View Random Cart Pole
# Basic Random Cart Pole Performance
run the basic cart pole code in the tutorial
View reacher-random.py
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()
You can’t perform that action at this time.