Skip to content

Instantly share code, notes, and snippets.

View Rijen's full-sized avatar

Матвей Бельский Rijen

View GitHub Profile
#include <stdio.h>
#include <locale.h>
#include <string.h>
void center_string(char *res_buf, char *s, int len)
{
int l_offset, r_offset;
l_offset = r_offset = (len - len % 2) / 2;
@Rijen
Rijen / gt_fish.md
Last active September 23, 2022 14:12

Речная рыба:

Река Замерзшая река Пустыня Пустынные озера
Щука + +
Радужная форель +
Лосось +
Малоротый окунь + +
Сом +
Желтый судак +
@Rijen
Rijen / Scheduler.php
Created January 25, 2022 19:00
Windows scheduler example
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace App\Support;
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
class LoginController extends Controller {
@Rijen
Rijen / client.go
Last active February 20, 2018 18:50
func (c *Client) listenWrite() {
log.Println("Listening write to client")
for {
select {
case msg := <-c.ch:
log.Println("Send: ", msg)
websocket.JSON.Send(c.ws, msg)
case <-c.doneCh:
c.server.Del(c)
c.doneCh <- true
@Rijen
Rijen / Трамваи с хуками, v2
Last active January 11, 2018 17:57
Проги для шахт
G2(F)L(HUK)G2(F)G3(h2)G2(F)-8L(F)Cdc0G1(i01)G2(iGO)L(iGO)Z2G2(HUK)L(rGO)Z4G2(F)L(lGO)Z3G2(F)L(t1)Cfc0M1Cgc0R1L(f1)Cfc0M1Cgc1R1L(t2)Cfc1M1Cgc1R1L(fr)Cfc1M1Cgc0R1L(i01)G3(t1)G1(STP)G3(t2)G1(STP)G3(f1)G1(rGO)G2(lGO)-6L(h1)cSG1(h1u)R0L(h1u)ZfG2(h1)-7L(h2)CdcfG0(h2u)R0L(h2u)Cdc1G0(F)ZdG2(h2)-X+G3(WAR)G2(h1)&G2(WAR)L(WAR)ZhR0L(STP)G3(h1)-2G3(WAR)G2(F)
Фичи: Хил при получении урона, пилик при виде игрока, в тупике входит в цикл хил-пилик.
@Rijen
Rijen / Assets.js
Created December 26, 2017 18:22
Beginner 2d Game Programming [JS] - 4 - Example
//more code
var candy = new Assets("candy", 'res/textures/candy.png', 30, 80)
candy.front = {
stand: candy.sheet.crop(20, 150),
step_l: candy.sheet.crop(60, 150),
step_r: candy.sheet.crop(100, 150)
}
//more code
@Rijen
Rijen / a.php
Last active November 29, 2017 20:41
<?
function crud($base, $controller, $name, &$app) {
$app->group($base, function() use($app, $controller, $name) {
$app->get('', $controller . ':index')->setName($name);
$app->get('/create', $controller . ':getCreate')->setName($name . '.create');
$app->get('/{id}/update', $controller . ':getUpdate');
$app->get('/{id}/delete', $controller . ':getDelete');
})->add(new RouteNameMiddleware($app->getContainer()));
$app->group($base, function() use($app, $controller) {
@Rijen
Rijen / Fibonacci.java
Last active August 20, 2017 15:13
PL JAVA: 1.9
public class Fibonacci {
static final int MAX_NUMBERS = 10;
public static void main(String[] args) {
FibonacciItem[] fibonacciItems = new FibonacciItem[MAX_NUMBERS];
fibonacciItems[0] = new FibonacciItem(1);
fibonacciItems[1] = new FibonacciItem(1);
<IfModule mod_rewrite.c>
RewriteEngine on
Options +FollowSymlinks
RewriteBase /
# перенаправление с без_www на www
#RewriteCond %{HTTP_HOST} !^www\. [NC]
#RewriteCond %{HTTP_HOST} ^(.+)$
#RewriteRule (.*) http://www.%1/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^pkbct.ru.ru$ [NC]