Skip to content

Instantly share code, notes, and snippets.

View krukru's full-sized avatar

Marko Kruljac krukru

View GitHub Profile
class Foo extends BaseAvroRecord {
public constructor(options: FooOptions) {
// ovdje ide mapiranje
}
}
interface FooOptions {
public requiredField1: string;
public requiredField2: number;
public optionalField3?: number;
export class ParentAvro extends BaseAvroRecord {
public static readonly schema: object = {}; // here is some schema object
@MyAvroDecorator(() => ChildAvro) // <-- Note the decorator
public child: ChildAvro;
public get schema(): object {
return ParentAvro.schema;
}
}
<?php
// src/Service/SomeService.php
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class SomeService
{
private $router;
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class DefaultController extends AbstractController
{
/**
@krukru
krukru / gist:6c799d760924e80d19038a6e9efabfdb
Created December 20, 2019 11:23
RDS get sleepy connections kill list
SELECT GROUP_CONCAT('CALL mysql.rds_kill(',id,')' SEPARATOR '; ') AS kill_list
FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE command='Sleep';
@krukru
krukru / gist:62e14ea921e60274f2b9dd04392173da
Created December 11, 2019 09:29
Ideolog php log format
Message pattern: ^\[(.*)\] (.+?)\.([A-Z]+): (.*)
Message start pattern: ^\[
Time format: yyyy-MM-dd HH:mm:ss
Time capture group: 1
Severity capture group: 3
Category capture group: 2
@krukru
krukru / bucket-policy.json
Created November 22, 2019 11:14
Limit S3 web access to only from our Office
{
"Version": "2012-10-17",
"Id": "Office-Only access",
"Statement": [{
"Sid": "Access-to-Office-IP-only",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:GetObject*",
"Resource": "arn:aws:s3:::BUCKET_NAME/*",
"Condition": {
@krukru
krukru / DialogueSystem.cs
Last active October 20, 2022 13:15
Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class DialogueSystem : MonoBehaviour
{
public ProgressiveText dialogueText;
public static DialogueSystem Instance { get; set; }
// services/validators/ExampleValidator.js
export class ExampleValidator {
validateFoo(input) {
return input.length === 5;
}
}
public function foo:
return this::bar
private function bar:
return new GithubApiClient