This file contains hidden or 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 Animal = function(name){ | |
this.name = name; | |
}; | |
Animal.prototype.speak = function(){ | |
console.log(this.name); | |
}; | |
var Dog = function(name){ | |
Animal.call(this, name); |
This file contains hidden or 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
# -*- coding:utf-8 -*- | |
''' | |
# Pangram | |
Determine if a sentence is a pangram. | |
Determine if a sentence is a pangram. A pangram (Greek: παν γράμμα, pan gramma, | |
"every letter") is a sentence using every letter of the alphabet at least once. | |
The best known English pangram is "The quick brown fox jumps over the lazy dog." |
This file contains hidden or 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
/* | |
Instructions: | |
1. Copy from line 8 to the end, into a new bookmark "Select all". The url is all the code below. It'll work (trust me). | |
2. In Facebook, open the event and Invite > Choose friends | |
3. Scroll down to load more of your friends. | |
4. Click on the "Select All" bookmark. You should see the friends being selected. It'll take a while, but it'll finish. | |
*/ | |
javascript:(function(){ | |
var DELAY = 250; | |
var found = document.querySelectorAll('a[aria-checked="false"]'); |
This file contains hidden or 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> | |
setInterval(function(){ | |
console.log(parent.behaviors); | |
}, 1000); | |
</script> | |
</head> |
This file contains hidden or 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 getDate = function(el){ | |
var date = el.querySelector('._5p0a').innerText; | |
var result = null; | |
var match = null; | |
var today = new Date().getDay(); | |
if (~date.indexOf('Tomorrow')){ | |
result = new Date(Date.now() + 86400); | |
if (~(result + '').indexOf('Invalid')) console.error('tomorrow', date); | |
return result; |
This file contains hidden or 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 last = $('.CardsList-progress span:last-child').text() * 1; | |
var getNext = function(){ return Math.floor(Math.random() * last) + 1; }; | |
var current = $('.CardsList-progress span:first-child').text() * 1; | |
var next = getNext(); | |
while (current == next) next = getNext(); | |
console.log('current: ', current, ' next: ', next, ' of: ', last); | |
var times = Math.abs(current - next); | |
while (times--){ | |
$((current < next) ? '.nextButton' : '.previousButton').click(); | |
} |
This file contains hidden or 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 Gosling(ratio,imageurl){this.ratio=ratio;this.imageurl=imageurl}var getGosling={init:function(myGosling){this.myGosling=myGosling},horizontal:function(){return this.myGosling.filter(function(myGosling){return myGosling.ratio==="horizontal"})},vertical:function(){return this.myGosling.filter(function(myGosling){return myGosling.ratio==="vertical"})},square:function(){return this.myGosling.filter(function(myGosling){return myGosling.ratio==="square"})}};function Randomize(images){return Math.floor(Math.random()*images.length)}var myGosling=[new Gosling("horizontal","http://heygirl.io/img/gosling-horiz-1.png"),new Gosling("horizontal","http://heygirl.io/img/gosling-horiz-2.gif"),new Gosling("horizontal","http://heygirl.io/img/gosling-horiz-3.jpg"),new Gosling("vertical","http://heygirl.io/img/gosling-vert-1.jpg"),new Gosling("vertical","http://heygirl.io/img/gosling-vert-3.jpg"),new Gosling("vertical","http://heygirl.io/img/gosling-vert-4.jpg"),new Gosling("vertical","http://heygirl.io/img/gosling-vert- |
This file contains hidden or 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
// ==UserScript== | |
// @name template | |
// @version 0.0.1 | |
// @namespace http://userscripts.org/users/253871 | |
// @description Get grades from an assignment from Google Classroom | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js | |
// @require http://jquery-jsonp.googlecode.com/files/jquery.jsonp-2.1.4.min.js | |
// ==/UserScript== | |
(function (){ | |
This file contains hidden or 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
#!/usr/bin/env python | |
""" | |
Very simple HTTP server in python. | |
Usage:: | |
./dummy-web-server.py [<port>] | |
Send a GET request:: | |
curl http://localhost |
This file contains hidden or 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
// Create or open an existing Sheet and click Tools > Script editor and enter the code below | |
// 1. Enter sheet name where data is to be written below | |
var SHEET_NAME = "Sheet1"; | |
// 2. Run > setup | |
// 3. Publish > Deploy as web app | |
// - enter Project Version name and click 'Save New Version' | |
// - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously) | |
// 4. Copy the 'Current web app URL' and post this in your form/script action | |
// 5. Insert column names on your destination sheet matching the parameter names of the data you are passing in (exactly matching case) |