Skip to content

Instantly share code, notes, and snippets.

View ilfey's full-sized avatar
:shipit:
https://nohello.net/

ilfey ilfey

:shipit:
https://nohello.net/
View GitHub Profile
@ilfey
ilfey / calc_true.yaml
Created June 12, 2023 13:12
Считает единички в последовательности 0 и 1 (если все 0, то ломается), для https://turingmachine.io/
input: '111'
blank: ' '
start state: START
table:
START:
1: {write: ' ', R: GO_RIGHT_WRITE_1}
0: {write: ' ', R: GO_RIGHT_WRITE_0}
' ': {R: GO_CALC}
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
void encrypt()
{
ifstream fin("input.txt");
if (fin.is_open())
@ilfey
ilfey / dump.sql
Created May 19, 2023 16:10
5 лаба по опбд
select * from students;
select surname, height from students;
select surname, height from students where weight between 50 and 75;
-- select * from groups;
select * from students where fk_group_id = (select groups_id from groups where lower(group_name) = '384');
select * from genders;
select * from students where fk_gender_id = (select gender_id from genders where lower(gender) = 'мужской');
@ilfey
ilfey / dump.sql
Created May 5, 2023 15:38
4 лаба по ОПБД
DELETE FROM Orders;
INSERT INTO Customer(FirstName, LastName, Email, Phone)
VALUES
('John', 'Doe', 'john.doe@example.com', '8-952-866-54-50'),
('Jane', 'Doe', 'jane.doe@example.com', '8-952-866-54-51'),
('Bob', 'Smith', 'bob.smith@example.com', '8-952-866-54-52'),
('Alice', 'Johnson', 'alice.johnson@example.com', '8-952-866-54-53'),
('Alex', 'Brown', 'alex.brown@example.com', '8-952-866-54-54'),
@ilfey
ilfey / scroll.ts
Last active May 4, 2023 08:05
scroll to element for react
function scrollToElement(el: HTMLElement, onScrollEnd = () => { }) {
const { top } = el.getBoundingClientRect()
var step = 75
var iterationsCount = Math.abs(Math.floor(top / step))
if (top < 0) {
step = -step
iterationsCount += 1
}
@ilfey
ilfey / settings.json
Created April 8, 2023 17:20
My VS Code setting.json
{
"terminal.integrated.defaultProfile.windows": "Command Prompt",
"editor.formatOnPaste": true,
"editor.largeFileOptimizations": true,
"editor.renderWhitespace": "none",
"editor.autoClosingBrackets": "always",
"editor.autoClosingOvertype": "always",
"editor.autoClosingQuotes": "always",
"editor.autoClosingDelete": "always",
@ilfey
ilfey / dump.sql
Created March 26, 2023 13:42
3 лаба по ОПБД
CREATE TABLE IF NOT EXISTS Product(
Id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
ProductName VARCHAR NOT NULL,
Manufacturer VARCHAR NOT NULL,
ProductCount INT NOT NULL,
Price MONEY NOT NULL
);
CREATE TABLE IF NOT EXISTS Customer(
Id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
@ilfey
ilfey / README.md
Last active March 26, 2023 11:34
1 лаба по ОПБД

playground

---
title: 1 lab
---
erDiagram
    workers {
        integer id PK
        varchar name
#include <iostream>
#include <fstream>
#include <cstring>
const char *sourceFileName = "source_file.txt";
const char *encodedFileName = "encoded_file.txt";
const char *decodedFileName = "decoded_file.txt";
@ilfey
ilfey / main.go
Created October 12, 2022 16:40
demotivator creator
package main
import (
"image"
"image/color"
"image/draw"
"image/png"
"golang.org/x/image/font"
"golang.org/x/image/font/basicfont"
"golang.org/x/image/math/fixed"