Skip to content

Instantly share code, notes, and snippets.

View shahmirj's full-sized avatar
💭
Who dares wins

Shahmir Javaid shahmirj

💭
Who dares wins
View GitHub Profile
@shahmirj
shahmirj / loader.php
Created July 4, 2015 12:20
Abstract load model
<?php
abstract class Base
{
abstract public static function load();
}
class Child
{
public static function load()
@shahmirj
shahmirj / Sniffer.trace
Created December 9, 2014 21:17
Code sniffer trace
[custom@custom.com]$ phpcs -p -n --standard=Custom --report-width=120 ./application
phpcs -p -n --standard=CUSTOM --report-width=120 ./application
Fatal error: Uncaught exception 'PHP_CodeSniffer_Exception' with message 'Class PHP_CodeSniffer_CommentParser_ClassCommentParser
not found' in /var/php/CodeSniffStandard/Custom/Sniffs/Commenting/ClassCommentSniff.php on line 18
PHP_CodeSniffer_Exception: Class PHP_CodeSniffer_CommentParser_ClassCommentParser not found in
/var/php/CodeSniffStandard/Custom/Sniffs/Commenting/ClassCommentSniff.php on line 18
Call Stack:
@shahmirj
shahmirj / Custom_Sniffs_Commenting_ClassCommentSniff.php
Created December 9, 2014 21:14
My Custom Sniffer for Bug report
<?php
if (class_exists('PHP_CodeSniffer_CommentParser_ClassCommentParser', true) === false) {
$error = 'Class PHP_CodeSniffer_CommentParser_ClassCommentParser not found';
throw new PHP_CodeSniffer_Exception($error);
}
if (class_exists('Custom_Sniffs_Commenting_FileCommentSniff', true) === false) {
$error = 'Class Custom_Sniffs_Commenting_FileCommentSniff not found';
throw new PHP_CodeSniffer_Exception($error);
@shahmirj
shahmirj / .ruleset.xml
Created November 7, 2014 11:24
My PHP Coding Standard
<?xml version="1.0"?>
<ruleset name="MyStandard">
<rule ref="PEAR">
<exclude name="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore"/>
<exclude name="PEAR.NamingConventions.ValidFunctionName.PrivateNoUnderscore"/>
<exclude name="PEAR.WhiteSpace.ScopeIndent"/>
</rule>
<rule ref="PSR1">
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
</rule>
@shahmirj
shahmirj / build.gradle
Created July 12, 2014 19:18
build.gradle for box2d when testing using JUnit
project(":core") {
apply plugin: "java"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
compile "junit:junit:4.11+"
}
}
@shahmirj
shahmirj / main.cpp
Created April 12, 2014 22:19
How iterators behave when elements are deleted.
#include <list>
typedef std::list<int> intContianer;
int main()
{
intContainer container;
container.push_back(1);
container.push_back(2);
container.push_back(3);