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
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { create: create }); | |
function create() { | |
var graphics = game.add.graphics(100, 100); | |
// draw a circle | |
graphics.lineStyle(2, 0x0000FF, 1); | |
graphics.beginFill(0xFFFF0B, 0.5); | |
graphics.drawCircle(470, 200, 200); |
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
var polygons = [ // A | |
[ // B | |
[ // C | |
[200, 100], // D | |
[350, 100], | |
[375, 200], | |
[150, 200], | |
], | |
[ | |
/* [210, 110], */ //[250, 110], |
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 lang="ru"> | |
<head> | |
<title>Format Date</title> | |
<meta charset="utf-8"> | |
<style type="text/css"> | |
input { | |
display : block; | |
} | |
</style> |
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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<style> | |
*, html, body { | |
margin: 0px; | |
padding: 0px; | |
} | |
table { |
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> | |
<style> | |
.list { | |
width : 250px; | |
} | |
.list table tbody tr td:first-child { | |
min-width: 250px; | |
} |
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 load () { | |
for (var i=0; i<60000; ++i) { | |
for (var j=60000; j>=0; --j) { | |
a = i*j; | |
} | |
} | |
} | |
function cpuConsume(count, cpuLoadFunc) { | |
var num = 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
const braces = '(())'; | |
const checkConsistance = (str) => { | |
const res = str | |
.split('') | |
.reduce( | |
(acc, current) => ({ | |
'(': () => { ++acc['(']; return acc; }, | |
')': () => { ++acc[')']; return acc; } | |
})[current](), { |
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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:orientation="horizontal" | |
android:clickable="true" | |
android:focusable="true" | |
android:layout_weight="1" | |
android:background="?android:attr/selectableItemBackground"> |
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
// [1, 3, 5, 7, 8, 11, 12, 13, 20] -> 1,3,5,7-8,11-13,20 | |
function short(arr) { | |
var sorted = arr.sort(function (a, b) { | |
if (a < b) { return -1; } | |
else if (a > b) { return 1; } | |
else { return 0; } | |
}); | |
function add(res, newValue) { | |
var last = res[res.length-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
'use strict'; | |
// Creates an array of truthy elements | |
const joinTruthy = (glue, ...args) => args.filter(arg => arg).join(glue); | |
// Simple bem function | |
export const bemUnbound = (blockName, elementName, options = {}) => [ | |
joinTruthy('__', blockName, elementName), | |
...Object | |
.entries(options) |
OlderNewer