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
# QEmu | |
brew install qemu | |
# Home for out tests | |
mkdir ~/arm-emu | |
cd ~/arm-emu | |
# Download initrd and kernel | |
wget http://ftp.de.debian.org/debian/dists/jessie/main/installer-armel/current/images/versatile/netboot/initrd.gz |
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
ssh-keygen -t rsa -b 4096 -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
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
<html> | |
<head> | |
<style> | |
body { | |
position: relative; | |
} | |
.cube { | |
position: absolute; | |
left: 100px; | |
top: 100px; |
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
#include <avr/io.h> | |
#include <util/delay.h> | |
int main(void) | |
{ | |
int i; | |
// PB0 and PB1 outputs | |
DDRB = (1<<PB0) | (1<<PB1); |
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
#include <avr/io.h> | |
#include <util/delay.h> | |
int main(void) | |
{ | |
int i; | |
// PB0 and PB1 outputs | |
DDRB = (1<<PB0) | (1<<PB1); |
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
/* | |
Read ADC2 (PB2) and output servo signal on PB0 and PB1. | |
ATtiny5 or 10 at default 1MHz. | |
*/ | |
#include <avr/io.h> | |
int main(void) | |
{ | |
// ADC channel 2 |
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
Алгоритм сравнения | |
Сравнение x==y , где x и y значения представляют true or false. Эти значения выполнены следующим образом: | |
1. Если Тип X такой же как тип Y, тогда: | |
a. Если Тип X undefined возвращает true. | |
b. Если Тип X Null возвращает true. | |
c. Если Тип X number тогда | |
i. если X NaN возвращает false. | |
ii. если Y NaN возвращает false. | |
iii.Если X такой же как Number и значение Y возвращает true. | |
iv. Если X +0 и Y -0 возвращает true. |
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 generateMonth = (date) => { | |
const getLocalDay = (date) => { | |
// конвертация в европейскую неделю | |
let day = date.getDay(); | |
if (day == 0) { // день 0 становится 7 | |
day = 7; | |
} | |
return day; |
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 fs = require('fs'); | |
var guid = /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/ig; | |
var inputFile = 'input.json'; | |
var outputFile = 'result.json'; | |
// читаем | |
fs.readFile(inputFile, 'utf8', function (err,data) { | |
if (err) { | |
return console.log(err); |
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'; | |
// simple express server | |
var express = require('express'); | |
var app = express(); | |
var router = express.Router(); | |
app.use(express.static('public')); | |
app.get('/', function(req, res) { | |
res.sendfile('./public/index.html'); |
NewerOlder