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 'benchmark/ips' | |
ARRAY = [1,2,3,1,'2',4,'5',6,7,8,9,'10'] | |
Benchmark.ips do |x| | |
x.report("for") { | |
result = [] | |
for number in ARRAY | |
result << number.to_s | |
end |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<script src="https://code.jquery.com/jquery-3.1.0.js"></script> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.wheredivgoes { |
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
#write your code here | |
def vowel?(letter) | |
['a', 'e', 'i', 'o', 'u'].include?(letter) | |
end | |
def process_letter(char, hash) | |
if hash[:first_vowel_not_found] | |
if vowel?(char) | |
hash[:before_first_vowel] << "ay" |
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 Request | |
constructor: (adr) -> | |
this.adr = adr | |
start: () -> | |
alert("start") | |
results: () -> | |
alert("result") | |
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
BEGIN{s,,=]=>%-{<-|}<&|`{,,y; -/:-@[-`{-};`-{/' -;,s,(.+)'$,$1*',&&s&&$_&gesex} |