Skip to content

Instantly share code, notes, and snippets.

View maht0rz's full-sized avatar
👨‍🍳

Matej Šima maht0rz

👨‍🍳
View GitHub Profile
Router::add('/test', function(){
echo "testing!'";
});
Router::add('/profile', function($id){
return [
'class' => '\App\Builders\ProfileBuilder',
'method' => 'displayProfile'
];
@maht0rz
maht0rz / RouterTests
Created September 15, 2014 09:37
Just a router example
<?php
Router::add('/test', function(){
echo "testing!'";
});
Router::add('/profile', function($id){
return [
'class' => '\App\Builders\ProfileBuilder',
Router::add('/(profile)/<:num>/<:doge>',function(){
echo "/test!";
})->alias([
'/(profile)' => 'GET'
]);
Router::alternatives()->add('<:num>', '(\\d+)');
Router::alternatives()->add('<:doge>', '(woof)');
<html>
<body>
@section('sidebar')
This is the master sidebar.
@show
<div class="container">
@yield('content')
</div>
</body>
var arr = [4,15,5,6,23,6,7,34,36];
arr.sort();
console.log(arr);
arr.push(16);
arr.sort();
@maht0rz
maht0rz / cpp_observer.cpp
Last active August 29, 2015 14:13
C++ learning - Observer pattern
/*
* File: main.cpp
* Author: maht0rz
*
* Created on January 9, 2015, 11:27 PM
*/
#include <iostream>
#include <list>
@maht0rz
maht0rz / observer.cpp
Created January 11, 2015 23:49
cpp learning - observer pattern
/*
* File: main.cpp
* Author: maht0rz
*
* Created on January 9, 2015, 11:27 PM
*/
#include <iostream>
#include <list>
@maht0rz
maht0rz / observer.cpp
Created January 13, 2015 21:53
Observer in c++
/*
* File: main.cpp
* Author: maht0rz
*
* Created on January 9, 2015, 11:27 PM
*/
#include <iostream>
#include <list>
#include <functional>
@maht0rz
maht0rz / gist:8e18de428707be483db0
Created February 18, 2015 17:24
Canvas engine
'use strict';
angular.module('proofOfConcept')
.controller('MainCtrl', function ($scope, LineFactory) {
var LineFactory = function(canvas, context){
var Line = function(from, to){
var coords = {
@maht0rz
maht0rz / glde.js
Last active August 29, 2015 14:15
Glorified Line Drawing Engine
var LineFactory = function(canvas, context){
var Line = function(from, to){
var coords = {
from: from,
to: to
}
this.drawOperationService = function(){