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"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div class="door_generator"> | |
<div class="top"></div> | |
<div class="gate"> |
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
// Alarm | |
var played = 0; | |
var time = prompt("Во сколько разбудить?", "6:55"); | |
var waiting = setInterval(function() { | |
if ((new Date()) > (new Date("May,05,2015,"+time)) && played == 0) { // it is time to awake? | |
played = 1; | |
document.getElementById('play72450163_91647005').click(); | |
clearInterval(waiting); | |
} | |
}, 1000 * 60 * 3); // to check every 3 minutes |
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
define(function (require) { | |
var patternYouTube = /\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9_\-]+)/i; | |
var patternVimeo = /(http|https):\/\/(www\.)?vimeo.com\/(\d+)($|\/)/; | |
var patternSoundCloud = /https:\/\/(www\.)?soundcloud.com.*/; | |
var patternLink = /([-a-zA-Z0-9:%_\+.~#?&\/\/=]{2,256}\.[a-z]{2,4}\b(\/?[-a-zA-Z0-9:%_\+.~#?&\/\/=]*)?)/gi; | |
var pattern = { | |
url : /\s([a-z0-9а-я.-_]+)\.([a-z0-9а-я._-]{2,10})/gi, // первый символ пробел!! | |
email : /([a-z0-9а-я._-]+)@([a-z0-9а-я._-]+)\.([a-z0-9а-я._-]{2,10})/gi, |
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
$(function() { | |
var min = 0; | |
var sec = 0; | |
$('table tr').each(function(e) { | |
var tr = $(this); | |
var phone = tr.find('td:nth-child(8)'); | |
var time = tr.find('td:nth-child(10)'); | |
if(phone.text()=='Телеф.') { | |
sec += parseInt(time.text().replace(/(\d+):(\d+)/, '$2')); | |
if(sec > 60) { |
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
Show hidden characters
{ | |
"auto_close_tags": true, | |
"auto_complete": true, | |
"auto_match_enabled": true, | |
"color_scheme": "Packages/User/SublimeLinter/base16-eighties (SL).tmTheme", | |
"draw_white_space": "all", | |
"enable_tab_scrolling": false, | |
"font_face": "Menlo", | |
"font_size": 18, | |
"highlight_line": true, |
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
$easing-swift: cubic-bezier(.4, 0, .2, 1); | |
$easing-swifter: cubic-bezier(.4, 0, 0, 1); | |
$easing-heavy: cubic-bezier(.7, 0, .6, 1); | |
$easing-swift-in: cubic-bezier(0, 0, .2, 1); | |
$easing-swift-out: cubic-bezier(.55, 0, .1, 1); |
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
// Converting NodeList to Arrays | |
[].slice.call(document.querySelectorAll(query)); | |
// Shuffling array’s elements | |
[1,2,3].sort(Math.random() - 0.5); // [2,1,3] | |
// Caching the array.length in the loop | |
for(var i = 0, length = array.length; i < length; i++) { | |
console.log(array[i]); | |
} |
OlderNewer