Skip to content

Instantly share code, notes, and snippets.

@adielfernandez
adielfernandez / StravaChallengeDataAnalysis.js
Last active April 1, 2023 14:18
Pulls valid activities and compiles mileage with multiplier for the Fun Group™
var url,maxPage=100,activityType="",p=1,done=0,entry=0,startTimeStamp=1673586e3,endTimeStamp=1680321601,totalDist=0,totalSkate=0,totalRide=0,totalRun=0,totalSkateElev=0,totalRideElev=0,totalRunElev=0,totalSkateTime=0,totalRideTime=0,totalRunTime=0,totalDistWithMult=0,totalElevation=0,totalTime=0;function formatNum(t){return t.toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function secToHrs(t){return(t/3600).toFixed(2)}for(;p<=maxPage;)url="https://www.strava.com/athlete/training_activities?keywords=&activity_type="+activityType+"&workout_type=&commute=&private_activities=&trainer=&gear=&new_activity_only=false&page="+p+"&per_page=20",jQuery.ajax({url:url,dataType:"json",method:"GET",success:function(t,e,a){for(i in t.models){var l=t.models[i].start_date_local_raw>startTimeStamp&&t.models[i].start_date_local_raw<endTimeStamp,o=t.models[i].type,n="VirtualRide"==o||"Ride"==o||"Hike"==o||"IceSkate"==o||"InlineSkate"==o||"Run"==o||"Snowboard"==o||"AlpineSki"==o;if(l&&n){var m=parseFloat(t.models[i].dis
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
#include "cinder/Log.h"
#include "cinder/Serial.h"
#include "Cinder-Serial.h"
using namespace ci;
using namespace ci::app;
{
"contentBroadcast" : {
"playlistId" : 189,
"faces" : [
{
"currentId" : 12,
"faceNum" : 0,
"nextId" : 174
},
{
[
{
"nid" : 17,
"title" : "baby's first sequence",
"active" : true,
"sequence_slides" : [
{
"nid": 0,
"title": "INNOVATION! Title slide",
"template_type" : "title_text",
@adielfernandez
adielfernandez / header.h
Created June 7, 2018 18:58
realsense2 to OF workflow
rs2::device_list _deviceList;
rs2::config _config;
rs2::pipeline _pipeline;
uint16_t *_depthBuff;
ofTexture _depthTex;
@adielfernandez
adielfernandez / gaussian.txt
Created March 7, 2018 23:24
Normalized Gaussian Distribution
float x;
float y = (1.0f / (0.4f * sqrt( glm::two_pi<float>() ) )) * exp( -0.5f * pow( ( x - 0.5f )/0.13, 2 ) );
@adielfernandez
adielfernandez / contrast.frag
Last active February 8, 2018 20:40
Simple Contrast Adjustment Shader
#version 330 core
in vec2 vTexCoord0;
out vec4 oColor;
uniform sampler2D uTex0;
uniform vec2 uResolution;
uniform float uExponent; //good values will be between 5 and 15
uniform float uShift; //good values will be between 0 and 1
#ifndef FrameCounter_h
#define FrameCounter_h
#endif /* FrameCounter_h */
#include "ofMain.h"
#pragma once
Current Frame (ofApp): 0
Current Frame (on_frame_ready): 0
Current Frame (on_frame_ready): 0
Cam 1 Frame Number: 0
Current Frame (ofApp): 1
Current Frame (on_frame_ready): 1
Current Frame (on_frame_ready): 1
Cam 1 Frame Number: 1
// MPU-6050 Short Example Sketch
// By Arduino User JohnChi
// August 17, 2014
// Public Domain
#include<Wire.h>
const int MPU=0x68; // I2C address of the MPU-6050
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;
void setup(){
Wire.begin();
Wire.beginTransmission(MPU);