Skip to content

Instantly share code, notes, and snippets.

@eghojansu
eghojansu / Terbilang.php
Last active August 29, 2015 14:26 — forked from ruliarmando/Terbilang.php
Terbilang Class
<?php
class Terbilang
{
public static function generate($angka) {
$angka = (float)$angka;
$bilangan = array(
'',
'satu',
'dua',
@eghojansu
eghojansu / .editorconfig
Created October 24, 2016 04:03
Init dev config
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@eghojansu
eghojansu / gulpfile-config.js
Last active October 28, 2017 04:38
Gulp dev-script
module.exports = {
vendor_js: [
// 'node_modules/path/to/vendor/**/*.js'
],
vendor_css: [
// 'node_modules/path/to/vendor/**/*.css'
],
fonts: [
// 'node_modules/**/*.{ttf,woff,woff2,eot,svg}'
],
@eghojansu
eghojansu / deployme.sh
Last active September 12, 2017 05:33
A Shell Script to "ZIP" deployment version of your code
#!/bin/bash
# Zipping Git Directory
# Usage:
# __THIS_FILE__ [ project_name ] [ version ]
#
# project_name -- default to directory name
# version -- default to latest version
#
# Timer from (http://www.linuxjournal.com/content/use-date-command-measure-elapsed-time)
#
@eghojansu
eghojansu / config_dev.yml
Last active September 11, 2017 09:40
Snippet for post Install nelmio/alice di Framework Symfony
# app/config/config_dev.yml
# NelmioAliceBundle setting (boleh ditempatkan diakhir file)
nelmio_alice:
locale: 'id_ID' # Default locale for the Faker Generator (id_ID untuk Indonesia Bahasa Indonesia)
seed: 1 # Value used make sure Faker generates data consistently across
# runs, set to null to disable.
functions_blacklist: # Some Faker formatter may have the same name as PHP
- 'current' # native functions. PHP functions have the priority,
- 'date' # so if you want to use a Faker formatter instead,
# blacklist this function here
@eghojansu
eghojansu / AppKernel.php
Created September 11, 2017 09:41
Snippet for post Install nelmio/alice di Framework Symfony
<?php
// app/AppKernel.php
class AppKernel extends Kernel
{
// ...
public function registerBundles()
{
// ...
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
@eghojansu
eghojansu / requirement.txt
Created September 11, 2017 09:45
Snippet for post Install nelmio/alice di Framework Symfony
doctrine/orm:^2.5
doctrine/doctrine-bundle:^1.6
doctrine/doctrine-fixtures-bundle:^2.4
nelmio/alice:^3.0@RC
@eghojansu
eghojansu / AppFixtures.php
Last active September 11, 2017 11:08
Snippet for post Install nelmio/alice di Framework Symfony
<?php
// src/AppBundle/DataFixtures/ORM/AppFixtures.php
namespace AppBundle\DataFixtures\ORM;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
use Nelmio\Alice\Loader\SimpleFileLoader;
use Symfony\Component\DependencyInjection\ContainerInterface;
@eghojansu
eghojansu / admin.yml
Created September 11, 2017 09:59
Snippet for post Install nelmio/alice di Framework Symfony
# src/AppBundle/DataFixtures/ORM/fixtures/admin.yml
AppBundle\Entity\Admin:
admin{1..2}:
name: '<firstName()> <lastName()>'
gender: '<myGender()>'
birthplace: '<city()>'
birthdate: '<dateTime()>'
user: '@userAdmin<current()>'
@eghojansu
eghojansu / CustomFakerProvider.php
Last active September 11, 2017 10:02
Snippet for post Install nelmio/alice di Framework Symfony
<?php
// src/AppBundle/DataFixtures/ORM/CustomProvider/CustomFakerProvider.php
namespace AppBundle\DataFixtures\ORM\CustomProvider;
use AppBundle\Utils\Config;
use Faker\Generator;
use Faker\Provider\Base;
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
use Symfony\Component\Security\Core\User\UserInterface;