This file contains hidden or 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
snail = function(arr) { | |
var top, bottom, left, right; | |
if (arr.length === 0) return []; | |
if (arr.length === 1) return arr[0]; | |
top = arr.shift(); | |
bottom = arr.pop().reverse(); | |
right = []; | |
left = []; |
This file contains hidden or 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
function validBraces(braces){ | |
var CLOSE_STACK = [], | |
CLOSE_SYMBOLS = '}])'.split(''), | |
OPEN_SYMBOLS = { '{' : '}', '[' : ']', '(' : ')' }; | |
for(var i = 0; i < braces.length; i++) { | |
if (CLOSE_SYMBOLS.indexOf(braces[i]) > -1 && CLOSE_STACK.pop() !== braces[i]) | |
return false; | |
else | |
CLOSE_STACK.push(OPEN_SYMBOLS[braces[i]]); |
This file contains hidden or 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" /> | |
<title>Besier Curve</title> | |
<style> | |
circle { | |
cursor: pointer; | |
} |
This file contains hidden or 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" /> | |
<title>Besier Curve</title> | |
<link rel="stylesheet" href="main.css"> | |
</head> | |
<body> | |
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
<script src="main.js"></script> |
This file contains hidden or 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
var users = []; | |
users = socket.Observable | |
.on('connect') | |
.map(function (socket) { | |
return socket; | |
}) | |
.until(function () { | |
return users.length != 10; |
This file contains hidden or 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
'use strict'; | |
%HERE% |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# Factorials | |
def fact(n) | |
return 1 if n == 1 | |
fact(n - 1) * n | |
end | |
def factReduce(n) |
This file contains hidden or 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
<?php | |
include 'wp-includes/class-phpmailer.php'; | |
$mail = new PHPMailer(); | |
$mail->setFrom('[email protected]', 'From Name'); | |
$mail->addAddress('[email protected]', 'To Name'); | |
$mail->Subject = 'Subject'; | |
$mail->msgHTML( 'Hello ..., ...' ); | |
$status = $mail->send(); |
This file contains hidden or 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
var asaki = 0; | |
if (asaki < 5) { | |
console.log("პატარა ხარ ძალიან!"); | |
} else if (asaki < 12) { | |
console.log("მხოლოდ მშობლების ნებართვით!"); | |
} else if (asaki < 20) { | |
console.log("კარგები ხართ!"); | |
} else { | |
console.log("უფროსებისთვის უკეთესი ალტერნატივა გვაქვს."); |
This file contains hidden or 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
var o = {}; | |
for (var i = 0; i < 100; i++) { | |
o['key' + i] = 'value ' + i; | |
} | |
exports.compare = { | |
//#3 | |
"for(var .. in ..)" : function () { | |
for(var key in o) { |
OlderNewer