I hereby claim:
- I am jameschevalier on github.
- I am jameschevalier (https://keybase.io/jameschevalier) on keybase.
- I have a public key whose fingerprint is 09FC 9A3C F705 17E5 3317 C898 CE60 730F F1EC 808D
To claim this, I am signing this object:
| [ | |
| ["Generic", "1"], | |
| ["Workout", "2"], | |
| ["General", "3"], | |
| ["Fartleks", "7"], | |
| ["Indoor Sport / Other Activity", "8"], | |
| ["Walk", "9"], | |
| ["Winter Sport / Activity", "10"], | |
| ["Bike Ride", "11"], | |
| ["Gym Workout", "12"], |
| --- EAST --- | |
| D'Marcus Williums | |
| T.J. Juckson | |
| T'varisuness King | |
| Tyroil Smoochie-Wallace | |
| D'Squarius Green, Jr. | |
| Ibrahim Moizoos | |
| Jackmerius Tacktheritrix | |
| D'Isiah T. Billings-Clyde |
| user = User.find(user_id) | |
| begin | |
| client = Strava::Api::V3::Client.new(access_token: user.token) | |
| strava_user = client.retrieve_current_athlete | |
| rescue => error | |
| if error.message.include?('"errors":[{"resource":"Athlete","field":"access_token","code":"invalid"') | |
| user.destroy and return | |
| else | |
| sleep 1 |
| SELECT DISTINCT wp_posts.post_title, wp_posts.post_content, wp_posts.post_date, wp_terms.name FROM wp_posts | |
| LEFT JOIN wp_postmeta ON(wp_posts.ID = wp_postmeta.post_id) | |
| LEFT JOIN wp_term_relationships ON(wp_posts.ID = wp_term_relationships.object_id) | |
| LEFT JOIN wp_term_taxonomy ON(wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) | |
| LEFT JOIN wp_terms ON(wp_term_taxonomy.term_id = wp_terms.term_id) | |
| WHERE wp_term_taxonomy.taxonomy = 'category' | |
| AND wp_posts.post_status = 'publish' | |
| AND wp_posts.post_type = 'post' |
| def self.circle_path(center, radius, complete_path = false) | |
| # For increased accuracy, if your data is in a localized area, add the elevation in meters to r_e below: | |
| r_e = 6378137.0 | |
| @@d2r ||= Math::PI/180 | |
| @@multipliers ||= begin | |
| segments = 16 | |
| dRad = 2*Math::PI/segments | |
| (segments + (complete_path ? 1 : 0)).times.map do |i| | |
| rads = dRad*i | |
| y = Math.sin(rads) |
| require 'mailchimp' | |
| mailchimp = Mailchimp::API.new(ENV['mailchimp_api_key']) | |
| mailchimp.lists.subscribe(ENV['mailchimp_list_id'], | |
| { email: '[email protected]' }, | |
| { 'FNAME' => 'First Name', 'LNAME' => 'Last Name' }, | |
| 'html', | |
| false) | |
| # So the format is: | |
| # mailchimp.lists.subscribe(list_id, { email: address }, { merge_vars }, 'email type', double_optin_boolean) |
I hereby claim:
To claim this, I am signing this object:
| set_one_ids = [1,2] | |
| set_two_ids = [3,4] | |
| set_one_query = Thing.where(id: id_set_one).where_values.reduce(:and) | |
| set_two_query = Thing.where(id: id_set_two).where_values.reduce(:and) | |
| Thing.where(set_one.or(set_two)) | |
| # That runs the SQL: | |
| # SELECT `things`.* FROM `things` WHERE ((`things`.`id` IN (1, 2) OR `things`.`id` IN (3, 4))) |
| response = HTTParty.post('https://oauth2-api.mapmyapi.com/v7.0/oauth2/access_token/', | |
| body: { grant_type: 'refresh_token', | |
| refresh_token: user.refresh_token, | |
| client_id: MAPMYFITNESS_CLIENT_KEY, | |
| client_secret: MAPMYFITNESS_CLIENT_SECRET }, | |
| headers: { 'Api-Key' => MAPMYFITNESS_CLIENT_KEY }) | |
| user.update_attributes!(access_token: response['access_token'], refresh_token: response['refresh_token']) |
| #!/usr/bin/env ruby | |
| Dir.glob('poly/*.poly').each_slice(50) do |group| | |
| bp_wx = '' | |
| group.each do |poly_file| | |
| file = File.basename(poly_file, '.poly') | |
| city, region = file.split('_') | |
| bp_wx << "--buffer bufferCapacity=50000"\ | |
| " --bp file='poly/#{city}_#{region}.poly'"\ |