Skip to content

Instantly share code, notes, and snippets.

View aliukevicius's full-sized avatar

Martynas Aliukevicius aliukevicius

View GitHub Profile
@aliukevicius
aliukevicius / System Design.md
Created June 6, 2016 10:57 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
<?php
use Facebook\FacebookSession;
use Facebook\FacebookRedirectLoginHelper;
use Facebook\FacebookRequest;
use App\Repositories\Oauth\OauthRepositoryInterface;
use App\Repositories\User\UserRepositoryInterface;
use App\Entities\User as UserEntity;
use App\Repositories\UserProfile\UserProfileRepositoryInterface;
@aliukevicius
aliukevicius / main.go
Created January 22, 2016 12:51
Golang datetime formats
package main
import (
"fmt"
"time"
"strings"
)
func main() {
@aliukevicius
aliukevicius / main.go
Last active January 11, 2016 06:10
Golang MySQL
package main
import (
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
)
func main() {
@aliukevicius
aliukevicius / main.go
Created January 10, 2016 15:57
Golang mondoDB
package main
import (
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
type Person struct {
@aliukevicius
aliukevicius / FileController.php
Created October 27, 2015 18:01
Image styles for laravel
<?php
class FileController extends Controller
{
/**
* Create image for the style
*
* @param $style
* @param $imageFile
*
@aliukevicius
aliukevicius / PriceInWords.php
Last active September 3, 2015 14:29
Display price in words
<?php
class PriceInWords {
protected $moneyNames = ['euras', 'eurai', 'eurų'];
protected $centNames = ['centas', 'centai', 'centų'];
/**
* Convert price into words
*
@aliukevicius
aliukevicius / gist:c9c972a0b218cc7811f0
Created October 10, 2014 08:18
NodeJs get Larvel sessionId from session cookie
// tested with Laravel 4.2.*
var PHPUnserialize = require('php-unserialize'); // npm install php-unserialize
var MCrypt = require('mcrypt').MCrypt; // npm install mcrypt
var encryptionKey = '---Laravel encription string---'
function ord( string ) { // Return ASCII value of character
return string.charCodeAt(0);
}