Skip to content

Instantly share code, notes, and snippets.

View atommarvel's full-sized avatar

Atom Raiff atommarvel

View GitHub Profile
var songs = document.getElementsByClassName("track-list ui-sortable")[1].children;
var final = "";
var trackInfo = "";
var artistName = "";
var trackName = "";
for (var track=0;track<songs.length;track++) {
trackInfo = songs[track].getElementsByClassName("track-info")[0];
artistName = trackInfo.getElementsByClassName("album-name")[0].textContent.trim();
trackName = trackInfo.getElementsByClassName("name")[0].textContent.trim();
final += artistName + " - " + trackName + "\n";
updateWidget: function(e){
//should be able to replace all these if statements by accessing the variable being changed which is identical to the target's name attribute
if(e.target.getAttribute("name")=="name"){
this.state.widget.setState({name: e.target.value});
return false;
}
else if(e.target.getAttribute("name")=="phone"){
this.state.widget.setState({phone: e.target.value});
return false;
}
@atommarvel
atommarvel / Goodbye Buzzfeed
Created November 13, 2013 19:04
Remove any post that contains the strings in strings2block. Initially it contains buzz, feed, and buzzfeed.
var posts = document.getElementsByClassName("userContent");
var strings2block = ["buzz","feed","buzzfeed"]
var doesPostContainBlock = function(postContent, blockContent){
for (y in blockContent){
if(postContent.search(blockContent[y])>0)
return true;
}
return false;
}
var loginMac = function(index, pw){
var macAddresses = ["f8:8f:ca:24:c4:ef" //glass
,"40:f4:07:67:35:82"]; //3ds
var username = document.getElementById("username");
var password = document.getElementById("password");
var mac = document.getElementById("devlogin_mac");
username.value = "araiff3"
password.value = pw;
mac.value = macAddresses[index];
@atommarvel
atommarvel / GDLE
Last active December 28, 2015 20:29
GTother Device Login Experience (GDLE) let's you manage your device logins for GTother in a snap. Be sure to add your login credentials to the beginning script to make it even faster.
// ==UserScript==
// @name GDLE
// @namespace http://www.atommarvel.com/
// @version 2.0
// @description GDLE let's you manage your device logins for GTother in a snap.
// @match https://auth.lawn.gatech.edu/*
// @copyright 2013+, Atom Marvel Raiff
// ==/UserScript==
//Add your account info here!
@atommarvel
atommarvel / Auto GT Login
Created November 20, 2013 05:28
Simply re-enables chrome's ability to autocomplete the login form for logging into tsquare,buzzport,degeeworks, etc
// ==UserScript==
// @name Auto GT Login
// @namespace http://www.atommarvel.com
// @version 1.0
// @description Simply re-enables chrome's ability to autocomplete the login form for logging into tsquare,buzzport,degeeworks, etc
// @match https://login.gatech.edu/*
// @copyright 2012+, Atom Marvel Raiff
// ==/UserScript==
document.getElementById("username").removeAttribute("autocomplete");
@atommarvel
atommarvel / google form buttons
Created December 5, 2013 20:19
Select all 2s for the cog-sci survey: https://docs.google.com/forms/d/1FkufmvCmpl4U8zf4eWc49f5OiNsOxmRT0INWQ6o_FuU/viewform just open up the javascript console (crtl-shift-i) and paste this in and hit enter
var btns = document.getElementsByClassName("ss-q-radio");
for(var x = 0; x<btns.length; x++){
if(parseInt(btns[x].getAttribute("value")) == 2)
btns[x].click();
}
//posting
var xmlhttp=new XMLHttpRequest();
var url = "http://marvel.com/my_account/my_must_reads";
var params = "id=";
xmlhttp.open("POST", url, true);
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlhttp.send(params);
//unchecking
test = document.getElementsByTagName("input")
@atommarvel
atommarvel / gist:10775638
Created April 15, 2014 21:14
canvas tut
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<canvas id="c"></canvas>
<script>
var canvas = document.getElementById("c");
var ctx = canvas.getContext("2d");
@atommarvel
atommarvel / UltimateUkulele
Last active August 29, 2015 14:19
Ultimate Ukulele bookmarklet
javascript:instr='ukulele';acc_tuning=decodeURIComponent('G C E A');$('body').removeClass('guitar');$('body').addClass('ukulele');$('.u_b').click();setTimeout(function(){$('.d_b').click();},500);void%200