Old:
def my_method(this, method, takes, a, bunch,
of, parameters):
New:
def my_method(this, method, now, takes,
a, bunch, of, different, parameters):
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 |
# 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 | |
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 |
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) |
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) |
require 'uri' | |
q1 = 'username=charlie&email=charlie@gmail' | |
q2 = 'user[username]=charlie&user[email]=charlie@gmail.com&user[password]=password' | |
q3 = 'user[address][street]=market&user[address][zipcode]=94103&user[email]=charlie@gmail.com' | |
puts URI.decode_www_form(q1).to_s | |
puts URI.decode_www_form(q2).to_s | |
puts URI.decode_www_form(q3).to_s |
$(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); | |
}) |
<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; |
// 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() { |