Skip to content

Instantly share code, notes, and snippets.

View kikill95's full-sized avatar

Kirill Gusyatin kikill95

View GitHub Profile
@kikill95
kikill95 / index.html
Last active October 13, 2020 11:40
LevelUp:coding - sample file for intro
<!doctype html>
<html lang="en">
<head>
<title>Мой сайт</title>
<style>
p {
color: red;
}
</style>
</head>
@kikill95
kikill95 / capture.html
Created June 12, 2018 13:49
Capture thumbnail on client side and prepare file to upload
<!DOCTYPE html>
<head>
<script type='text/javascript'>
window.onload = function () {
var video = document.getElementById('videoId')
var canvas = document.getElementById('canvasId')
canvas.style.display = 'block'
// fake loading
setTimeout(() => {
// start when video loaded
@kikill95
kikill95 / timer.js
Last active October 17, 2019 20:25
This is a module (short version) for gathering timers
// full version (with functions for cluster) can be found here:
// https://github.com/kikill95/profiler-demo/blob/master/timer.js
/*
** Example of usage (more samples there - https://github.com/kikill95/profiler-demo)
...
timer.time('metrics', 'wrapper')
...
timer.timeEnd('metrics', 'wrapper')
@kikill95
kikill95 / ExcelToJsDate.js
Last active April 25, 2018 14:18 — forked from christopherscott/ExcelToJsDate.js
Convert Excel date values to JavaScript date objects
// Convert Excel dates into JS date objects
//
// @param excelDate {Number}
// @return {Date}
function getJsDateFromExcel(excelDate) {
// JavaScript dates can be constructed by passing milliseconds
// since the Unix epoch (January 1, 1970) example: new Date(12312512312);
@kikill95
kikill95 / index.html
Created April 17, 2018 10:15
Detect file mime type using magic numbers and JavaScript
<!doctype html>
<html lang="en">
<head>
<title>Filereader</title>
<style>
div {
font-family: "Helvetica Neue";
line-height:22px;
font-size:15px;
margin:10px 0;
@kikill95
kikill95 / index.vr.js
Last active December 3, 2017 22:05
Example of ReactVR usage
import React from 'react'
import Location from 'Location'
import {
AppRegistry,
asset,
Pano,
View,
VrButton,
Model,
Sound,
@kikill95
kikill95 / client.js
Created December 3, 2017 21:31
Example of simple-raycaster usage
import {VRInstance} from 'react-vr-web'
import * as SimpleRaycaster from 'simple-raycaster'
function init (bundle, parent, options) {
const vr = new VRInstance(bundle, 'gdg_reactvr', parent, {
raycasters: [
SimpleRaycaster // Add SimpleRaycaster to the options
],
cursorVisibility: 'visible', // Add cursorVisibility
...options
@kikill95
kikill95 / easy_coding.js
Last active July 6, 2017 10:43
Implement the following functions
1. // isPrime - Returns true or false, indicating whether the given number is prime.
isPrime(0) // false
isPrime(1) // false
isPrime(17) // true
isPrime(10000000000000) // false
2. // factorial - Returns a number that is the factorial of the given number.
factorial(0) // 1
factorial(1) // 1
factorial(6) // 720
@kikill95
kikill95 / webpack.config.js
Created May 3, 2017 06:09
webpack.config.js
const webpack = require('webpack')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const path = require('path')
const sourcePath = path.resolve(__dirname, 'public')
const isProduction = process.env.NODE_ENV === 'production'
const stats = {
assets: true,
@kikill95
kikill95 / index.jses6
Last active April 5, 2017 07:01
js modules, do you understand following:
// imports es6
import defaultMember from "module-name";
import * as name from "module-name";
import { member } from "module-name";
import { member as alias } from "module-name";
import { member1 , member2 } from "module-name";
import { member1 , member2 as alias2 } from "module-name";
import defaultMember from "module-name";
import defaultMember, * as name from "module-name";
import "module-name";