Skip to content

Instantly share code, notes, and snippets.

View andri-sudarmawijaya's full-sized avatar

Andri Sudarmawijaya andri-sudarmawijaya

View GitHub Profile
@andri-sudarmawijaya
andri-sudarmawijaya / desa_koordinat.php
Created March 7, 2020 15:41 — forked from nim4n136/desa_koordinat.php
Cara mendapatkan koordinat / longitude latitude Desa wilayah indonesia dengan openstreetmap dengan php
<?php
$wilayah = [
// nama desa
'desa' => "Sukaluyu",
// nama kecamatan
'kecamatan' => "Tamansari",
// nama kabupaten
'kab_kota' => "Bogor",
// nama provinsi
@andri-sudarmawijaya
andri-sudarmawijaya / seed_derivatives.drush.inc
Created January 14, 2020 00:06 — forked from jimconte/seed_derivatives.drush.inc
This script can generate image derivatives for Drupal for warming up the filesystem prior to going live. Image derivative generation puts an amount of load on the servers so it images have been migrated from another server with no derivatives, it may be useful to pre-generate using this script.
<?php
use Drupal\Core\Database\Database;
use Drupal\Core\Database\Query\Condition;
use Drupal\image\Entity\ImageStyle;
use Drupal\file\Entity\File;
/**
* ================================================================
* Implements hook_drush_command().
* ----------------------------------------------------------------
@andri-sudarmawijaya
andri-sudarmawijaya / directprinting.php
Created October 28, 2019 06:30 — forked from anestan/directprinting.php
direct printing php dot matrix
<?php
//set printing option to raw
$tmpdir = sys_get_temp_dir(); # ambil direktori temporary untuk simpan file.
$file = tempnam($tmpdir, 'ctk'); # nama file temporary yang akan dicetak
$handle = fopen($file, 'w');
$condensed = Chr(27) . Chr(33) . Chr(4);
$bold1 = Chr(27) . Chr(69);
$bold0 = Chr(27) . Chr(70);
$initialized = chr(27).chr(64);
@andri-sudarmawijaya
andri-sudarmawijaya / 1README.md
Created January 3, 2018 11:50 — forked from joseluisq/1README.md
How add a custom field to Laravel 5.4 default login. LoginController.php

How add a custom field to Laravel 5.4 default login controller.

In this php example (app/Http/Controllers/Auth/LoginController.php) my model is called Client and the custom field for login validation is status. (Client->status)

Add in your resources/lang/en/auth.php file :

    'failed_status' => 'Your account is inactive yet. Please confirm your e-mail address.',