This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOLLOG = { | |
HEY: function(URTHING) { | |
if (typeof console != "undefined") { | |
try { | |
var error = (new Error().stack); | |
var URNUMBER = error.substring(error.lastIndexOf("\n")).match(/:[0-9]+:/)[0].replace(":", ""); | |
console.log(URNUMBER, URTHING); | |
} catch (a) {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1. be logged into fitocracy | |
//2. open chrome console | |
//3. paste this in | |
//4. figure out the activityId of the exercise you want to look up rep PRs for. you can do this by looking at network traffic in the "You -> Performance" section of the site (this script uses the same endpoint that the performance graphs use). chrome dev tools noobs, check out this highly sophisticated diagram: http://i.imgur.com/TvImk93.png | |
//5. change the parameter passed in to the id of whatever exercise you looked up in step 4. this gist is passing in an activityId of "1" on line 26, which happens to be bench press (lol @ bench press having an id of 1. bro level: xenowang/dicktalens). | |
//6. run it and enjoy your json of PRs! | |
(function(activityId){ | |
$.ajax({ | |
url: "https://www.fitocracy.com/_get_activity_history_json/?activity-id=" + activityId, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>My Site!</title> | |
<script src="main.js"></script> | |
</head> | |
<body> | |
<a id="link" href="#" onclick="calculate()">asdf</a> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
//we'll do ajax stuff here | |
</script> | |
</head> | |
<body> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (options) { | |
if (typeof options !== "object" || typeof options.startDate === "undefined" || options.startDate === "") { | |
options.startDate = new Date("1/1/2000"); | |
} | |
else{ | |
options.startDate = new Date(options.startDate); | |
} | |
if (typeof options !== "object" || typeof options.endDate === "undefined" || options.endDate === "") { | |
var today = new Date(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>My Site!</title> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script> | |
<script src="main.js"></script> | |
</head> | |
<body> | |
<div id="friendMessage"></div> | |
<a id="calculationLink" href="#" onclick="calculate()">dust calculation</a> | |
<a href="#" onclick="favoriteThings()">favorite things</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myAge = 27; | |
var maxAge = 100; | |
var coffeePerDay = 2; | |
var lifetimeSupply = (maxAge - myAge) * coffeePerDay * 365; | |
var message = "You will need " + lifetimeSupply + " cups of coffee to last until your old age of " + maxAge; | |
alert(message); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myAge = 27; | |
var maxAge = 100; | |
var coffeePerDay = 2; | |
var lifetimeSupply = (maxAge - myAge) * coffeePerDay * 365; | |
if (lifetimeSupply > 40000){ | |
alert("you drink too much coffee"); | |
} else { | |
alert("you'll probably be fine"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>My Site!</title> | |
<script src="myjavascriptfile.js"></script> | |
</head> | |
<body> | |
<a href = "#" onclick="calculate()"> | |
Calculate life time supply | |
</a> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>My Site!</title> | |
</head> | |
<body> | |
<img id="mainpicture" src="http://girldevelopit.com/assets/pink-logo.png"> | |
<br/> | |
<a href="#" onclick="favoriteThings()"> | |
Favorite Things | |
</a> |
OlderNewer