Skip to content

Instantly share code, notes, and snippets.

View esvit's full-sized avatar
🤖
coding...

Vitalii Savchuk esvit

🤖
coding...
View GitHub Profile
@esvit
esvit / index.html
Created October 23, 2019 21:28
TV Noise
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.ui-tvnoisecanvas {
@esvit
esvit / solution.html
Last active January 16, 2018 12:30
Eliftech School Solution
<!doctype html>
<html lang="en">
<body>
<script>
const url = 'https://www.eliftech.com/school-task';
void async function() {
let res = await fetch(url);
const { id, expressions } = await res.json();
const results = expressions.map(expression => {
let stack = [], a, b;
@esvit
esvit / youtubeReporting.js
Created October 25, 2015 16:21
Youtube Reporting API for googleapis, generated by instruction http://esvit.name/youtube-content-id/youtube-content-id-using-node-js.html
/**
* Copyright 2014 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/**
* Copyright 2014 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@esvit
esvit / rename.php
Created May 16, 2015 05:54
Recursive rename encoded cyrillic files (like #U0411...) to UTF-8 (wordpress problem)
<?php
function utf8_urldecode($str) {
$str = preg_replace("/%u([0-9a-f]{3,4})/i","&#x\\1;",urldecode($str));
$str = html_entity_decode($str,null,'UTF-8');
//$str = iconv('UTF-8', 'windows-1251', $str);
return $str;
}
$str = utf8_urldecode($str);
@esvit
esvit / gist:7527827
Last active December 28, 2015 16:19
category edit
<select class="form-control" ng-model="item.category_id">
<option ng-selected="!item.category_id">-</option>
<option value="{{ category.id }}" ng-repeat="category in categories" ng-selected="item.category_id == category.id">
{{ category.prefix }}{{ category.title|language }}
</option>
</select>
CategoryResource.get(function (data) {
@esvit
esvit / nginx.conf
Created November 6, 2013 18:11 — forked from Stanback/nginx.conf
server {
listen 80;
listen [::]:80;
server_name yourserver.com;
root /path/to/your/htdocs;
error_page 404 /404.html
index index.html;
@esvit
esvit / index.html
Last active December 26, 2015 00:09
ngTable: Getting Started
<html>
<head lang="en">
<meta charset="utf-8">
<title>Getting Started With ngTable Example</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/esvit/ng-table/master/ng-table.js"></script>
<link rel="stylesheet" type="text/css" href="https://raw.github.com/esvit/ng-table/master/ng-table.css" />
</head>
<body>
@esvit
esvit / config.php
Last active December 25, 2015 06:39
Bazalt ORM Handler for WhoopsPHP
$handler->addDataTableCallback('ORM', function() {
list($query, $params) = \Bazalt\ORM\Connection\Manager::getConnection()->getLastQuery();
$fullQuery = \Bazalt\ORM\Query::getFullQuery($query, $params);
$output = array(
'Full' => $fullQuery,
'Query' => $query,
'Params' => print_r($params, true)
);
return $output;
@esvit
esvit / index.html
Last active October 29, 2017 07:42
ngTable Example #1: Table with pagination
<html>
<head lang="en">
<meta charset="utf-8">
<title>Getting Started With ngTable Example</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/esvit/ng-table/master/ng-table.js"></script>
<link rel="stylesheet" type="text/css" href="https://raw.github.com/esvit/ng-table/master/ng-table.css" />
</head>
<body>