Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View piotrpasich's full-sized avatar

Piotr Pasich piotrpasich

View GitHub Profile
---
extends:
- tslint-config-standard
- tslint-clean-code
- tslint-sonarts
- tslint-consistent-codestyle
- tslint-plugin-ikatyang
- tslint-microsoft-contrib
- tslint-immutable
rules:
---
extends:
- tslint-config-standard
- tslint-clean-code
- tslint-sonarts
- tslint-consistent-codestyle
- tslint-plugin-ikatyang
- tslint-microsoft-contrib
- tslint-immutable
rules:
---
extends:
- tslint-config-standard
- tslint-clean-code
- tslint-sonarts
- tslint-consistent-codestyle
- tslint-plugin-ikatyang
- tslint-microsoft-contrib
- tslint-immutable
rules:
@piotrpasich
piotrpasich / iterator.php
Created January 27, 2015 06:59
Iterator
<?php
$start = microtime(true);
$mem = memory_get_usage();
function t() {
global $argv;
$array = array();
for ($i = 0; $i < $argv[1]; $i++) {
$array[] = rand(0, 100);
}
@piotrpasich
piotrpasich / 0_reuse_code.js
Created January 12, 2014 20:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
//Save the Route
class Router {
/** ... **/
public static function connect($route, $defaults = array(), $options = array());
/** ... **/
<?php
$roles = array('ROLE_USER', 'ROLE_ADMIN');
if ( ! in_array('RULE_SUPER_ADMIN', $roles)) {
echo "RULE_SUPER_ADMIN not found\n";
}
$roles = array('ROLE_USER', 'ROLE_ADMIN',true);
if (in_array('RULE_SUPER_ADMIN', $roles)) {
echo "RULE_SUPER_ADMIN found: it is not funny\n";
<?php
class AdController extends Controller
{
/**
* @Route("/ad", name="ad")
*/
public function indexAction(Request $request)
{
$criterias = $this->get('advertisement.criterias')->resolveRequest($request);
app/console xsolve:doctrine:crud
app/console xsolve:generate:crud
assetic:
debug: %kernel.debug%
use_controller: false
bundles: [ 'XsolveBootstrapCrudBundle']
filters:
cssrewrite: ~
less:
node: /usr/local/bin/node
node_paths: [/usr/local/lib/node_modules]
apply_to: ".less$"