Skip to content

Instantly share code, notes, and snippets.

@benwillkommen
benwillkommen / gist:3994668
Created November 1, 2012 16:12
have a blix
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) {}
}
@benwillkommen
benwillkommen / fitocracyRepPR.js
Last active January 4, 2016 21:29
fitocracy.com rep PR console script
//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,
<html>
<head>
<title>My Site!</title>
<script src="main.js"></script>
</head>
<body>
<a id="link" href="#" onclick="calculate()">asdf</a>
</body>
</html>
<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>
@benwillkommen
benwillkommen / total-push-ups.js
Created March 20, 2014 23:43
fitocracy total push ups console script
(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();
<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>
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);
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");
<html>
<head>
<title>My Site!</title>
<script src="myjavascriptfile.js"></script>
</head>
<body>
<a href = "#" onclick="calculate()">
Calculate life time supply
</a>
</body>
<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>