Skip to content

Instantly share code, notes, and snippets.

View Rexagon's full-sized avatar
🦀

Ivan Kalinin Rexagon

🦀
View GitHub Profile
@Rexagon
Rexagon / neuronet.js
Created December 10, 2015 18:04
Short net class for node.js
var ETA = 1.0;
var ALPHA = 0.3;
var BETA = 0.1;
function Connection () {
this.weight = Math.random();
this.deltaWeight = 0;
}
function Neuron (numOuputs, id) {
@Rexagon
Rexagon / bf.cpp
Last active May 9, 2016 12:43
Brainfuck console interpreter
#include <iostream>
#include <string>
#include <map>
#include <stack>
#include <vector>
#include <fstream>
class Script
{
public:
@Rexagon
Rexagon / badass_login.php
Created October 30, 2016 20:03
Bitrix auth
<?php
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
$USER->Authorize(1);
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php");
?>
@Rexagon
Rexagon / quicksort.cpp
Created December 8, 2016 07:38
Just simple quicksort with right element as pivot
void quicksort(int arr[], int left, int right)
{
if (left < right) {
int pivot = arr[right];
int i = left - 1;
for (int j = left; j <= right-1; j++)
{
if (arr[j] <= pivot)
{
#include <iostream>
#include <fstream>
#include <string>
#include <GL\glew.h>
#include <SDL\SDL.h>
#ifdef main
#undef main
#endif // main
sfml-graphics-s.lib
sfml-network-s.lib
sfml-window-s.lib
sfml-system-s.lib
sfml-audio-s.lib
opengl32.lib
openal32.lib
freetype.lib
winmm.lib
ws2_32.lib
sql.query('TRUNCATE TABLE shipments').then(function(rows) {
sql.query('SELECT cc.* FROM containers_content cc INNER JOIN containers cn ON cc.container=cn.id ORDER BY date_departure ASC').then(function(rows) {
var containers_content = rows;
var requests = [];
var j = 0;
for (var i = 0; i < containers_content.length; i++) {
requests.push(function(callback) {
@Rexagon
Rexagon / lab_1.pr
Created September 7, 2017 12:55
Prolog first lab
predicates
nondeterm solve(real, real, real)
nondeterm reply(real, real, real)
nondeterm print_complex(real, real)
nondeterm run
nondeterm do(char)
clauses
solve(A,B,C):-
A=0 AND B=0 AND C<>0,
@Rexagon
Rexagon / task_3.pr
Last active October 13, 2017 15:53
Second prolog lab
DOMAINS
i = integer
PREDICATES
nondeterm count(i, i, i)
nondeterm counter(i, i, i, i)
nondeterm menu(i)
CLAUSES
count(M, S, B):-
@Rexagon
Rexagon / ResourceManager.h
Last active June 23, 2022 13:33
C++ resource manager
#pragma once
#include <typeindex>
#include <memory>
#include <string>
#include <map>
#include "Resource.h"
class AbstractFactory