-
Open a browser
# start an instance of firefox with selenium-webdriver driver = Selenium::WebDriver.for :firefox # :chrome -> chrome # :ie -> iexplore
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
// add all the elements inside modal which you want to make focusable | |
const focusableElements = | |
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'; | |
const modal = document.querySelector('#exampleModal'); // select the modal by it's id | |
const firstFocusableElement = modal.querySelectorAll(focusableElements)[0]; // get first element to be focused inside modal | |
const focusableContent = modal.querySelectorAll(focusableElements); | |
const lastFocusableElement = focusableContent[focusableContent.length - 1]; // get last element to be focused inside modal | |
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 StreamingController < ApplicationController | |
include ActionController::Live | |
before_filter :require_user | |
def index | |
Rails.logger.info "streaming#index" | |
ActiveRecord::Base.connection_pool.release_connection # current_user already loaded in before filter |
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
$ = jQuery | |
$window = $(window) | |
methods = | |
init: (options = {}) -> | |
return this.each () -> | |
$this = $(this) | |
offset = $this.offset() | |
x = undefined |
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
$ = jQuery | |
special_codes = | |
8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl" | |
18: "alt", 19: "pause" | |
20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown" | |
35: "end", 36: "home" | |
37: "left", 38: "up", 39: "right", 40: "down", 45: "insert" | |
46: "del" |
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
#jtip { | |
z-index: 11; | |
position: absolute; | |
max-width: 200px; | |
.arrow { | |
position: absolute; | |
top: 0px; | |
width: 0; | |
height: 0; | |
margin: 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
require 'rspec/autorun' | |
def get_results(string, s_i, chars, c_i ) | |
finds = [] | |
while i = string.index(chars[c_i], s_i) | |
if chars[c_i + 1] | |
if more_finds = get_results(string, i + 1, chars , c_i + 1) | |
finds += more_finds.map{|a| a.unshift(i)} | |
else | |
return nil |
Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discussions around concrete examples, not handy-waving abstractions. Don't say you did something, provide a URL that proves it.
Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.
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 Animal | |
constructor: (@name) -> | |
move: (meters) -> | |
console.log @name + " moved #{meters}m." | |
class Snake extends Animal | |
@beans: -> | |
console.log("I eat beans") |
NewerOlder