Skip to content

Instantly share code, notes, and snippets.

View syzspectroom's full-sized avatar
🥸
I may be slow to respond.

syzspectroom

🥸
I may be slow to respond.
View GitHub Profile
@syzspectroom
syzspectroom / server.js
Created March 10, 2025 12:02 — forked from FelipeBudinich/server.js
Barebones KICK OAuth and Webhooks implementation
const express = require('express');
const crypto = require('crypto');
const axios = require('axios');
require('dotenv/config');
const app = express();
// Capture the raw body for signature verification.
app.use(express.json({
verify: (req, res, buf, encoding) => {

Test Task: Calendar Component Architecture for React Native

Objective:

Design a modular and maintainable architecture for a calendar component suitable for a React Native application, focusing on architectural planning rather than full implementation. Optionally, create a simple working monthly calendar that demonstrates the architecture in action.

Core Task Requirements:

Requirements:

{
"buildings": {
"radiant": {
"dota_goodguys_tower1_top": {
"health": 1771,
"max_health": 1800
},
"dota_goodguys_tower2_top": {
"health": 2500,
"max_health": 2500
{
"match": {
"server_steam_id": 90137856241120259,
"matchid": 5564510148,
"timestamp": 701,
"game_time": 537,
"game_mode": 21,
"league_id": 11751,
"league_node_id": 0,
"game_state": 5

Завдання 1:

використовуючи лише Rack(http://rack.github.io) написати простий веб додаток, який розбирає набір вхідних параметрів в GET запиті(приклад: http://localhost:9292/?field1=value1&field2=value2&field3=value3) та повертає їх в веб браузер у вигляді таблиці:

key value
field1 value1
field2 value2
field3 value3

(пояснення, як працювати з Rack можна знайти тут: https://gist.github.com/markbates/4240848)

class Test
include Benchmark
def a
sleep 10
p 'a'
end
def b
p 'b'
end
require "minitest/autorun"
class Rtest < Minitest::Test
def setup
@cars = 100.times.inject([]) do |arr, i| arr.push(
id: i,
price: rand(1000..25000),
color: [:red, :blue, :white, :yellow, :black][rand(5)]
)
end
@syzspectroom
syzspectroom / docs.md
Last active April 3, 2018 13:32
docs.md

RESTful URLs

General guidelines for RESTful URLs

  • A URL identifies a resource.
  • URLs should include nouns, not verbs.
  • Use plural nouns only for consistency (no singular nouns).
  • Use HTTP verbs (GET, POST, PUT, DELETE) to operate on the collections and elements.
  • You shouldn’t need to go deeper than resource/identifier/resource.
  • Put the version number at the base of your URL, for example http://example.com/v1/path/to/resource.
  • URL v. header:
@syzspectroom
syzspectroom / .rubocop.yml
Created March 13, 2018 12:36
.rubocop.yml
AllCops:
TargetRubyVersion: 2.3
Include:
- Rakefile
- config.ru
- lib/**/*.rake
Exclude:
- db/schema.rb
- logs
@syzspectroom
syzspectroom / sidekiq.service
Created February 28, 2018 14:18
/lib/systemd/system/sidekiq.service
#
# Sidekiq auto start using systemd unit file for Ubuntu 16.04
#
# Put this in /lib/systemd/system (Ubuntu).
# Run:
# 1. systemctl enable sidekiq (to enable sidekiq service)
# 2. systemctl {start,stop,restart} sidekiq (to start sidekiq service)
#
# This file corresponds to a single Sidekiq process. Add multiple copies
# to run multiple processes (sidekiq-1, sidekiq-2, etc).