Skip to content

Instantly share code, notes, and snippets.

View urakozz's full-sized avatar
🎯
Focusing

Yury Kozyrev urakozz

🎯
Focusing
View GitHub Profile
@urakozz
urakozz / ResNet.ts
Created October 21, 2020 17:30
ResNet.ts
import * as tf from "@tensorflow/tfjs-node";
// In my case I have 256x256 pictures
const IMG_SIZE = 256;
const NUMBER_OF_CHANNELS = 3;
// Batch normalisation and ReLU always go together, let's add them to the separate function
const batchNormRelu = (input: tf.Tensor4D) => {
const batch = tf.layers.batchNormalization().apply(input);
return tf.layers.reLU().apply(batch);
@urakozz
urakozz / copyFirebaseUsers.js
Created October 7, 2020 16:11
Export/import firebase users from one account to another
const admin = require("firebase-admin");
const serviceAccountOld = require("./../../.serviceAccountKey.json");
const serviceAccountNew = require("./../../.serviceAccountKey-new.json");
const appOld = admin.initializeApp({
credential: admin.credential.cert(serviceAccountOld),
databaseURL: "https://old.firebaseio.com",
}, "old");
const appNew = admin.initializeApp({
credential: admin.credential.cert(serviceAccountNew),
@urakozz
urakozz / main.go
Last active February 4, 2019 10:00
Golang snippets
package main
import "io"
func main() {
}
// Storager - interface, naming recommendation is to have 'er' ending
type Storager interface {
@urakozz
urakozz / frontend.md
Last active December 23, 2019 19:53
Dev learning paths
@urakozz
urakozz / reset_orange_pi_overclock.sh
Last active March 18, 2018 15:47
Orange PI safe overclock settings
#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
if [ "$(id -u)" != "0" ]; then
echo "This script must be executed as root. Exiting" >&2
exit 1
fi
@urakozz
urakozz / command.sh
Created October 9, 2017 18:09
ffmpeg video downloader
ffmpeg -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_delay_max 2000 \
-timeout 2000000000 -y -thread_queue_size 5512 -nostdin -hide_banner -fflags +genpts \
-probesize 10000000 -analyzeduration 15000000 -strict -2 \
-i "http://185.38.12.37/sec/1507602961/37303231b693a468b631da8dce8ab261f039288f1e73a0e5/ivs/69/18/89f2c8aa6418.mp4/hls/tracks-1,4/index.m3u8" 2bg.s04e07.ts
@urakozz
urakozz / broadcast.go
Last active May 8, 2017 14:53
Go broadcast to the network
package main
import (
"log"
"net"
"strconv"
"time"
)
const (
@urakozz
urakozz / main.go
Created January 12, 2017 08:50
Go Context, parallel computing
package main
import "fmt"
import (
"context"
"time"
"math/rand"
"sync"
)
@urakozz
urakozz / drivenow.js
Created December 13, 2016 16:03
Drive Now
"use strict";
let https = require("https");
let headers = {
"Accept": "application/json;v=1.8",
"Origin": "https://de.drive-now.com",
"X-Language": "de",
@urakozz
urakozz / promise.js
Created December 21, 2015 10:25
Promises
# Then
var Promise = require('promise');
var fs = require('fs')
var read = Promise.denodeify(fs.readFile)
#Bluebird #1
var Promise = require('bluebird');
var fs = require('fs');
var readFile = Promise.promisify(fs.readFile);