- http://www.ted.com/talks/max_little_a_test_for_parkinson_s_with_a_phone_call.html
- http://www.ted.com/talks/hannah_fry_is_life_really_that_complex.html
- http://www.ted.com/talks/eric_berlow_how_complexity_leads_to_simplicity.html
- http://www.ted.com/talks/lang/en/simon_sinek_how_great_leaders_inspire_action.html
- http://www.ted.com/talks/david_logan_on_tribal_leadership.html
- http://www.ted.com/talks/tristram_stuart_the_global_food_waste_scandal.html
- http://ed.ted.com/lessons/how-sugar-affects-the-brain-nicole-avena#watch
- http://www.ted.com/talks/ric_elias.html
- http://www.ted.com/talks/russell_foster_why_do_we_sleep.html
- http://www.ted.com/talks/yves_morieux_as_work_gets_more_complex_6_rules_to_simplify.html
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 'ripper' | |
require 'pp' | |
sexp = Ripper.sexp '"Hello #{ friend } vs Hello #{friend}"' | |
pp sexp | |
# [:program, | |
# [[:string_literal, | |
# [:string_content, |
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
# Adapted slightly from Sam Dutton | |
# Set name of hidden property and visibility change event | |
# since some browsers only offer vendor-prefixed support | |
hidden = undefined | |
state = undefined | |
visibilityChange = undefined | |
if typeof document.hidden isnt "undefined" | |
hidden = "hidden" | |
visibilityChange = "visibilitychange" | |
state = "visibilityState" |
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
// скрипт учитывает повторные голосования пользователей и максимум 3 картинки от одного пользователя | |
var numbers = {}; | |
var voted_users = {}; | |
$(".comment").each(function(i, comment) { | |
var user_id = $(comment).find("a[role='comment-user']").attr("href"); | |
console.log(user_id) | |
if(voted_users[user_id] == 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
require 'benchmark/ips' | |
require 'benchmark' | |
Benchmark.ips do |r| | |
r.report("one") do | |
'string' + 'string' | |
end | |
r.report("two") do | |
"string" + "string" |
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' | |
Benchmark.ips do |r| | |
r.report("mass") do | |
a, b, c, d = 1, 2, 3, 4 | |
end | |
r.report("step by step") do | |
a = 1 | |
b = 2 |
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 smart_subtract(arr_1, arr_2, action) | |
hash_1 = Hash[arr_1] | |
hash_2 = Hash[arr_2] | |
result = [] | |
hash_1.each do |key, value| | |
if hash_2[key] | |
result << [key, value.send(action, hash_2[key])] | |
else | |
result << [key, value] |
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 'net/http' | |
require 'uri' | |
require 'json' | |
def send_operation() | |
data = { | |
operation: { | |
operation_id: "24215140440800001402186", | |
amount: 571.13, | |
direction: "in", |
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 'net/http' | |
require 'uri' | |
require 'json' | |
def send_operation() | |
data = { | |
cpa: { | |
amount: "24215140440800001402186", | |
datetime: "2007-09-01T21:30:04.000+04:00", | |
} |
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 'net/http' | |
require 'uri' | |
require 'json' | |
def send_operation() | |
data = { | |
customer_count: { | |
count: "45", | |
datetime: "2007-09-01T21:30:04.000+04:00", | |
} |