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
// Tired of getting Meetup.com notifications? Me too. | |
// 1. Navigate to: http://www.meetup.com/account/comm/ (you must be logged in!) | |
// 2. Open your browser's console, and paste in the script below: | |
$('.commSettings').each(function(idx, item) {var $item = $(item);var boardId = $item.attr("id").split('_')[1];var url = $item.children('form').attr('action');var params = {evRemind:1,mailing_list_status:0, submitButton:'Save Settings', submit:'submit'};params['board_' + boardId] = boardId;$.ajax({data: params, url: url, type: 'post'});});$('.generalEmailSettings').find('input[type="checkbox"]').prop('checked', false);$('.generalEmailSettings').find('input[type="submit"]').click(); |
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. Go to pokemon.com/us/pokedex | |
// 2. Copy + paste script into the console to reveal n pokemon and download their png source files. | |
// * change 151 to whatever number you like to download more / less pokemon. | |
var figures, | |
n = 151, | |
currentLength = 0; | |
loadMore.click(); | |
var downloadImages = function() { |
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> | |
<style> | |
body * { | |
box-sizing: border-box; | |
} | |
.boat { | |
background-image: url(http://www.lively-dragon.com/Resources/Pictures/boat_seating.png); | |
background-size: 100% auto; |
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() { | |
$('body').one('click', function(event) { | |
var halfHeight = window.innerHeight / 2; | |
var halfWidth = window.innerWidth / 2; | |
var horizontalRule = $('<div style="width: 100%; height: ' + halfHeight + 'px; border: 0; border-bottom: thin solid blue; position: absolute; top:0;left:0"></div>'); | |
var verticalRule = $('<div style="width: ' + halfWidth + 'px; height: 100%; border: 0; border-right: thin solid blue; position: absolute; top:0;left:0"></div>'); | |
$('body').append(horizontalRule); | |
$('body').append(verticalRule); | |
}) |
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
require 'uri' | |
q1 = 'username=charlie&email=charlie@gmail' | |
q2 = 'user[username]=charlie&user[email][email protected]&user[password]=password' | |
q3 = 'user[address][street]=market&user[address][zipcode]=94103&user[email][email protected]' | |
puts URI.decode_www_form(q1).to_s | |
puts URI.decode_www_form(q2).to_s | |
puts URI.decode_www_form(q3).to_s |
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
require 'selenium-webdriver' | |
username = 'your_username' | |
pword = 'your_pword' | |
browser = Selenium::WebDriver.for :firefox | |
browser.get 'https://linkedin.com' | |
wait = Selenium::WebDriver::Wait.new(:timeout => 10) |
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
class Enumerable | |
def deep_dup | |
self.map do |*elements| | |
if element.is_a?(Enumerable) | |
element.deep_dup | |
else | |
elements.map do |element| | |
begin | |
duplicate = element.class.allocate | |
duplicate.send(:initialize_copy, element) |
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
def subsets(array) | |
return [[]] if array.empty? | |
first = array.shift | |
subs = subsets(array) | |
other_subs = subs.map do |sub| | |
sub = sub + [first] | |
end | |
other_subs + subs |
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
# for all numbers between 1 and a number, | |
# which can you add to the number infinitely | |
# (wrapping around when you hit the number) | |
# such that every number is stopped at once | |
def check_intervals(num) | |
best_intervals = [] | |
current_max = 0 | |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') | |
" let Vundle manage Vundle, required |
OlderNewer