Skip to content

Instantly share code, notes, and snippets.

@severuykhin
severuykhin / GAN-and-trainable.py
Created October 14, 2021 19:46 — forked from naotokui/GAN-and-trainable.py
How model.trainable = False works in keras (GAN model)
# coding: utf8
## based on this article: http://qiita.com/mokemokechicken/items/937a82cfdc31e9a6ca12
import numpy as np
from keras.models import Sequential
from keras.engine.topology import Input, Container
from keras.engine.training import Model
from keras.layers.core import Dense
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@severuykhin
severuykhin / phone.php
Created July 26, 2017 18:46
phones.php
<?if(isset(Yii::$app->request->cookies['newNumber'])){?>
(8332) <?echo Yii::$app->request->cookies['newNumber'];?> - директор<br>
(8332) <?echo Yii::$app->request->cookies['newNumber'];?> - бухгалтерия<br>
(8332) <?echo Yii::$app->request->cookies['newNumber'];?> - производственный отдел<br>
(8332) 428-000 - услуги спецавтотехники
<?}else{?>
<?= $config['contacts_phone1'] ?><br>
<?= $config['contacts_phone2'] ?><br>
<?= $config['contacts_phone3'] ?><br>
(8332) 428-000 - услуги спецавтотехники
@severuykhin
severuykhin / Patterns.js
Created June 25, 2017 17:54
JavaScript patterns practice
/*********************************************
*
* Strategy
*
**********************************************/
const weapons = {
sword: {
'name': 'Excalibur',
'damage': 20
@severuykhin
severuykhin / gulp.txt
Created June 21, 2017 20:10
gulp tips
1.laze require =>
Ленивая загрузка модулей - при загрузке отсутствующего модуля, lazyequire загрузит его
gulp_tasks/config/index.js - лежит основной конфиг проета
@severuykhin
severuykhin / nav.js
Created June 3, 2017 09:12
Dynamic navigation
(function($){
//Get elements
var sections = $('section'),
menuItems = $('.sidenav-item'),
sectionsPosition = [],
itemsValues = {};
//Get sections positions from top
for (var i = 0, length = sections.length; i < length; i++) {
@severuykhin
severuykhin / scroll.js
Created May 14, 2017 11:37
Scroll detection
$('element').bind('DOMMouseScroll mousewheel', function(e){
event.preventDefault();
if(e.originalEvent.wheelDelta > 0 || e.originalEvent.detail < 0) {
//Actions
}
else{
//Actions
}
});
@severuykhin
severuykhin / cookie.js
Created April 8, 2017 22:12
get cookie
@severuykhin
severuykhin / OOP3.js
Created April 2, 2017 19:19
JavaScript OOP example 3
//Prototype inheritance
//===================================================================
function Machine (power) {
var self = this;
self._enabled = false;
this._power = power;
@severuykhin
severuykhin / OOP2.js
Created April 2, 2017 15:03
JavaScript OOP examples w
//Coffie machine constructor
//===================================================================
function CoffeMachine(power, capacity){
//Define private vars //Сохранение контекста для обрращения к нему из внутренних функций
const WATER_HEAT_CAPACITY = 4200;
const POWER = power;
var timerId;