Skip to content

Instantly share code, notes, and snippets.

View ibolmo's full-sized avatar
🧠

Olmo Maldonado ibolmo

🧠
View GitHub Profile
var Animal = function(name){
this.name = name;
};
Animal.prototype.speak = function(){
console.log(this.name);
};
var Dog = function(name){
Animal.call(this, name);
# -*- 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."
/*
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"]');
<html>
<head>
<script>
setInterval(function(){
console.log(parent.behaviors);
}, 1000);
</script>
</head>
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;
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();
}
@ibolmo
ibolmo / heygirl.js
Created October 1, 2015 03:18
credit: heygirl.io
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-
// ==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 (){
@ibolmo
ibolmo / dummy-web-server.py
Last active August 29, 2015 14:26 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@ibolmo
ibolmo / Code.gs
Last active June 7, 2016 07:46 — forked from bmcbride/Code.gs
// 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)