Skip to content

Instantly share code, notes, and snippets.

@Vchekryzhov
Vchekryzhov / UDPer.cs
Created June 12, 2018 14:15 — forked from zmilojko/UDPer.cs
C# sends and receives UDP broadcasts
using System;
using System.Net.Sockets;
using System.Net;
using System.Text;
using System.Threading;
namespace UDPer
{
class UDPer
{
@Vchekryzhov
Vchekryzhov / conectionToNodeViaTelnet
Last active June 13, 2018 14:57
Connection to node via telnet
var net = require("net"),
repl = require("repl");
connections = 0;
repl.start({
prompt: "node via stdin> ",
input: process.stdin,
output: process.stdout
});
net.createServer(function(socket) {
connections += 1;
@Vchekryzhov
Vchekryzhov / .eslintrc
Last active June 20, 2018 10:45
esLint
{
esversion: 6,
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
@Vchekryzhov
Vchekryzhov / parser.rb
Created June 17, 2018 16:58
Парсер ксв json
# Парсит электронную таблицу сохраненую в формате csv в json
# В первой строке должны быть записаны ключи
# run: ruby parser.tb filename.csv
# Пример
# -------------------
# Имя | Улица |дом|
# -------------------
# Андрей|Ленина |44 |
# Денис |Маркса |98 |
# ||
@Vchekryzhov
Vchekryzhov / subscribe.js
Created June 19, 2018 19:45
subscribe knockout with old value
ko.subscribable.fn.subscribeChanged = function( callback ) {
var oldValue;
return [
this.subscribe( function( _oldValue ) {
oldValue = _oldValue;
}, this, 'beforeChange' ),
this.subscribe( function( newValue ) {
callback( newValue, oldValue );
} )
];
@Vchekryzhov
Vchekryzhov / rename all
Created September 17, 2018 08:56
bash scripts
#Переименование файлов
j=0;
for i in *.jpg;
do let j+=1;
mv $i file$j.jpg ;
done
@Vchekryzhov
Vchekryzhov / 1laba
Created September 19, 2018 18:36
laba sokolov
<script>
var points = [];
function generatePoints(){
for(var i =0; i< 100; i++)
points.push({
'x': parseInt(Math.random() * 100),
'y': parseInt(Math.random() * 100),
});
}
generatePoints()
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace KozakLaba2Ind
{
class Program
{
<script>
var X = [];
for (var i = 0; i < 100; i++)
{
X[i] = {'x':Math.random() * 100), 'y':Math.random() * 100, 'z':Math.random() * 100};
}
F = [];
private void SetDataToServer(){
if(SearchServer.ipServer == ""){
SearchServer udp = new SearchServer();
udp.Start();
udp.Send("softPLC");
}
System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
string vel = plcValue_vel.TextValue;
string pos = plcValue_state.TextValue;