Skip to content

Instantly share code, notes, and snippets.

View pringgojs's full-sized avatar
🎯
Focusing

Pringgo J. Saputro pringgojs

🎯
Focusing
  • Ponorogo, Indonesia
View GitHub Profile
{
"workbench.startupEditor": "newUntitledFile",
"files.autoSave": "onFocusChange",
"editor.tabSize": 2,
"eslint.packageManager": "yarn",
"eslint.validate": [
"javascript",
"html",
"javascriptreact",
{
@pringgojs
pringgojs / Fix fungsi setValue phpWord
Created August 19, 2019 09:25
Digunakan untuk men set value di Word dengan pencarian ${string_yang_akan_direplace}
Tambahkan fungsi berikut di file `PhpOffice\PhpWord\TemplateProcessor`
// dev
public function setValueAdvanced($search_replace)
{
foreach ($this->tempDocumentHeaders as $index => $headerXML) {
$this->tempDocumentHeaders[$index] = $this->setValueForPartAdvanced($this->tempDocumentHeaders[$index], $search_replace);
}
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt|assets)
RewriteRule ^(.*)$ http://localhost/client/dinas-simpak/index.php/$1 [L]
@pringgojs
pringgojs / BlogController.php
Created March 24, 2019 10:01 — forked from tobysteward/BlogController.php
Laravel AJAX Pagination with JQuery
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()
rm -rf node_modules
rm package-lock.json
npm cache clear --force
npm install
@pringgojs
pringgojs / merubah collection to array
Created January 22, 2019 10:34
merubah collection to array
public static function listPengawasArray()
{
$array_pengawas = self::where('user_id', auth()->user()->id)->get(['pengawas_id'])->mode('pengawas_id');
}
// response
array:2 [▼
0 => 1
1 => 2
]
# MEMPERBAIKI ERRO TOKEN MISMATCH KETIKA LOGIN
chmod 777 ./storage/framework/sessions
# ROUTING PUBLIC DIREKTORY LARAVEL TIDAK BISA DIRUBAH
# REDIRECT OTOMATIS KE FOLDER PUBLIC
BUAT FILE .htaccess di root folder
$("[data-dismiss=modal]").trigger({ type: "click" });
@pringgojs
pringgojs / Error can't attach user permission
Created November 1, 2018 02:22
--- Attach permision Seeder Started ---
Errors accours when run php artisan dev:reset on `UserSeeder:attachPermission`.
Make it solved with `config/database.php` like this
```php
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => true,
'strict' => false,
'engine' => null,
@pringgojs
pringgojs / api.php
Created October 22, 2018 14:53
routing api
<?php
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These