Skip to content

Instantly share code, notes, and snippets.

View adhocore's full-sized avatar
🎯
Focusing

Jitendra Adhikari adhocore

🎯
Focusing
View GitHub Profile
@adhocore
adhocore / fizzbuzz.php
Created December 8, 2013 16:27
Fizzbuzz implementation in PHP with minimal codes
<?php
// PHP fizzbuzz implementation by Jitendra Adhikari
// see: http://content.codersdojo.org/code-kata-catalogue/fizz-buzz/
//
// if you have shorter/smarter ways out, please fork or comment...
echo implode('<br/>', array_map(function($d){
return ($d%15==0)?'fizzbuzz':($d%5==0?'buzz':($d%3==0?'fizz':$d));
}, range(1,100)));
@adhocore
adhocore / constantAccess.php
Last active December 30, 2015 06:09 — forked from samundra/constant access.php
dynamic access constant - fork | making more promising and fail-safe
<?php
/* fork: making more promising and fail-safe */
class RegionVO {
const NSW = 35;
const ACT = 37;
const VIC = 38;
const QLD = 9;
const SA = 36;
@adhocore
adhocore / MagentoTranslateCSVGenerator.php
Created November 22, 2013 13:29
a handy tool that generates CSV data for magento theme translation
<?php
/**
* Generates data with ready-to-edit CSV for magento translation
*
* A handy tool that generates CSV data for magento theme translation
* You can set the $mode to:
* a) either write that data to translate.csv at path you specify,
* b) or just to dump that data in browser for you to copy and use (default).
* In the write mode it appends new data to translate.csv thus you dont