Skip to content

Instantly share code, notes, and snippets.

View aambrozkiewicz's full-sized avatar

Aleksander Ambrozkiewicz aambrozkiewicz

View GitHub Profile
@aambrozkiewicz
aambrozkiewicz / RGB.cpp
Created November 9, 2010 18:30
Arduino 3x1 byte wise RGB Serial driven LED
#include "RGB.h"
#include "WProgram.h"
RGB::RGB(uint8_t r, uint8_t g, uint8_t b)
{
Rpin = r;
Gpin = g;
Bpin = b;
}
@aambrozkiewicz
aambrozkiewicz / MY_Loader.php
Created April 21, 2011 18:54
CodeIgniter MY_Loader, displays used template before actual output in HTML comment
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Loader extends CI_Loader
{
function view($view, $vars = array(), $return = FALSE)
{
if ($return != TRUE)
echo "<!-- $view -->\n";
return ($return == TRUE ? "<!-- $view -->\n" : '') . $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));
}
@aambrozkiewicz
aambrozkiewicz / Punkty.cs
Created May 15, 2011 17:30
Mariuszowe punkty
using System;
namespace ConsoleApplication1
{
enum PointType
{
Point2D,
Point3D
}
@aambrozkiewicz
aambrozkiewicz / index.php
Created July 16, 2011 15:37
aleksandera.pl under hood
<?php
require_once 'app/app.php';
require_once 'app/view.php';
$app = new app;
try {
$app->get('/404', function() {
echo view::render('views/404.php');
<?php
// error_reporting(E_ALL);
require_once 'app/autoload.php';
require_once 'app/view.php';
$app = new App\App;
$app->get('/', function() {
@aambrozkiewicz
aambrozkiewicz / Snake.cpp
Created May 29, 2015 19:05
C++ Snake game
#include <cstdlib>
#include <iostream>
#include <windows.h>
#include <time.h>
#include "Snejk.h"
using namespace std;
CSnejk::CSnejk()
<?php
interface StringSignatureStorage
{
function save(string $resourceId, array $keys);
}
interface StringStorageInterface
{
function fetch(string $resourceId);
@aambrozkiewicz
aambrozkiewicz / vue-js-shopping-cart.html
Created October 10, 2015 14:46
Vue.js shopping cart example
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>vue eatally</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" type="text/css" media="screen">
<style type="text/css" media="screen">
body {
background-color: #f4f4f4;
<?php
// php hax0r.php "witam" | pbcopy
$alphabet = [
'a' => '/-\\',
'b' => '|3',
'c' => '(',
'd' => '|)',
'e' => 'E',
@aambrozkiewicz
aambrozkiewicz / Transactional.php
Created January 15, 2017 14:40
Laravel Middleware with Database transaction
<?php
namespace App\Http\Middleware;
use Closure;
class Transactional
{
public function handle($request, Closure $next)
{