#Quiz:
-
What’s the result of:
function A() {} A.prototype.name = 'A'; var a = new A(); var b = new A();
| ### Quiz: | |
| 1. What is result of next line of code? | |
| typeof null | |
| Answer: | |
| * `null` | |
| * `object` | |
| * `undefined` |
| # | |
| # A CORS (Cross-Origin Resouce Sharing) config for nginx | |
| # | |
| # == Purpose | |
| # | |
| # This nginx configuration enables CORS requests in the following way: | |
| # - enables CORS just for origins on a whitelist specified by a regular expression | |
| # - CORS preflight request (OPTIONS) are responded immediately | |
| # - Access-Control-Allow-Credentials=true for GET and POST requests |
#Quiz:
What’s the result of:
function A() {}
A.prototype.name = 'A';
var a = new A();
var b = new A();
#Quiz:
What’s the result of:
console.log(f());
function f() {
return 1;
}
Answers:
| sudo ifconfig en0 down; sleep 1; sudo ifconfig en0 up | |
| Write a program, which outputs numbers from 0 to 1000 without: | |
| loops (do, while, for, etc.) | |
| jumps (goto) | |
| exceptions | |
| conditions | |
| boolean operators (and, or, etc.) | |
| comparison operators (<, >, etc.) | |
| ranges | |
| preprocessor shit |
| sudo chown -R $USER /usr/local | |
| sudo chown -RL mysql:mysql /usr/local/mysql/data |
| { | |
| "args": | |
| { | |
| "cycle": "previous" | |
| }, | |
| "auto_complete": false, | |
| "color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme", | |
| "command": "alternative_autocomplete", | |
| "context": | |
| [ |
| t1 = Time.now | |
| file = File.new(ARGV[0] || "input.txt", "r") | |
| numbers = file.readlines.map!(&:to_i) | |
| p Time.now - t1 | |
| [231552, 234756, 596873, 648219, 726312, 981237, 988331,1277361,1283379].each do |x| | |
| tmp = Array.new(numbers.size) | |
| time = Time.now | |
| res = numbers.detect { |el| tmp[el] || ((x - el) > 0 && (tmp[x - el] = true) && false) } ? 'yes' : 'no ' | |
| p "#{'%7.0f' % x} - #{res} - #{Time.now - time}" |