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:
# Server | |
apt-get update | |
apt-get install -y python-software-properties | |
add-apt-repository -y ppa:webupd8team/java | |
apt-get update | |
apt-get install -y oracle-java7-installer sysstat convmv ruby1.9.3 | |
wget http://bretth.dev.openstreetmap.org/osmosis-build/osmosis-latest.tgz | |
mkdir osmosis | |
tar -xvzf osmosis-latest.tgz -C osmosis | |
chmod a+x osmosis/bin/osmosis |
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']) |
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))) |
I hereby claim:
To claim this, I am signing this object:
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) |
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' |
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 |
[ | |
["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"], |
// Begin Debug Output | |
echo "Debug Output for VARIABLENAME:<br><pre>"; | |
var_dump($VARIABLENAME); | |
echo "</pre><br>End of debug output."; | |
// End Debug Output |
<!DOCTYPE html> | |
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8" /> |