Skip to content

Instantly share code, notes, and snippets.

View mysiar's full-sized avatar
🌐
Working remotely

Piotr Synowiec mysiar

🌐
Working remotely
View GitHub Profile
@mysiar
mysiar / react-native-elements.js
Created September 30, 2017 07:25
React Native Elements
const SocialIcons =
[
"glass",
"music",
"search",
"envelope-o",
"heart",
"star",
"star-o",
"user",
@mysiar
mysiar / Coding Convention.txt
Last active September 19, 2017 17:15
Coding Convention
╔═══════════════════════╦═════════════╦════════════╦══════════════╦════════════╦════════════╗
β•‘ PHP Project β•‘ Classes β•‘ Methods β•‘ Properties β•‘ Functions β•‘ Variables β•‘
╠═══════════════════════╬═════════════╬════════════╬══════════════╬════════════╬════════════╣
β•‘ Akelos Framework β•‘ PascalCase β•‘ camelCase β•‘ camelCase β•‘ lower_case β•‘ lower_case β•‘
β•‘ CakePHP Framework β•‘ PascalCase β•‘ camelCase β•‘ camelCase β•‘ camelCase β•‘ camelCase β•‘
β•‘ CodeIgniter Framework β•‘ Proper_Case β•‘ lower_case β•‘ lower_case β•‘ lower_case β•‘ lower_case β•‘
β•‘ Concrete5 CMS β•‘ PascalCase β•‘ camelCase β•‘ camelCase β•‘ lower_case β•‘ lower_case β•‘
β•‘ Doctrine ORM β•‘ PascalCase β•‘ camelCase β•‘ camelCase β•‘ camelCase β•‘ camelCase β•‘
β•‘ Drupal CMS β•‘ PascalCase β•‘ camelCase β•‘ camelCase β•‘ lower_case β•‘ lower_case β•‘
β•‘ Joomla CMS β•‘ PascalCase β•‘ camelCase β•‘ camelCase β•‘ camelCase β•‘ camelCase β•‘
@mysiar
mysiar / CachedEntityRepository.php
Last active June 10, 2017 10:42
Result Cached Entity Rpository
moved
@mysiar
mysiar / PDO database connection Class with single static method
Last active December 11, 2021 17:22
PDO database connection Class with single static method
// dbconfig.json
{
"server": "localhost",
"dbname": "cl_shop",
"user" : "root",
"pass" : "root"
}
// class definition
class DB {
@mysiar
mysiar / classBowlingGame.php
Created September 20, 2016 05:10
Bowling Game
class BowlingGame {
private $rolls = array();
private $currentRoll = 0;
public function __construct() {
for ($i = 0; $i < 21; $i++) {
$this->rolls[$i] = 0;
}
}
public function del_slow($id) {
$offset = 0;
foreach ($this->products as $p) {
if ($p->getId() == $id) {
array_splice($this->products, $offset, 1);
break;
}
$offset++;
}
}
@mysiar
mysiar / remove element from array
Last active September 1, 2016 07:10
remove element from array
/**
* callback for array_filter to get array without element with $id
*/
class idNotEqual {
private $id;
function __construct($id) {
$this->id = $id;
}