Skip to content

Instantly share code, notes, and snippets.

View imsus's full-sized avatar
🏠
Working from home

Imam Susanto imsus

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am imsus on github.
  • I am imsus (https://keybase.io/imsus) on keybase.
  • I have a public key ASCcPDHpA2AInGnTv-S1VgNMYGia8JreANlxIKMdfbOWAwo

To claim this, I am signing this object:

@imsus
imsus / list.md
Created May 21, 2018 20:59 — forked from notwaldorf/list.md
Meownica's packing list

Meownica's packing list

I travel a lot so I'm down to like 30 minutes of packing per any kind of trip. I always bring one carry-on suitcase for any trips up to 2 weeks (that I never check in unless forced) -- I have an Away suitcase because it's got a built-in (removable) battery, and amazing wheels.

🚨

  • 🆔Wallet & Passport
  • 💧Travel water bottle
  • 💳Travel credit cards (don't pay foreign currency fees!)
  • 💳Insurance cards
  • 💵Local currency you have
  • 🚎Local public transport cards
@imsus
imsus / sample.txt
Created February 6, 2019 10:13
Telegram Instant View Boilerplate
# This sample template explores how we can turn the Telegram blog post on the left into an Instant View page as shown on the right — in several simple steps. If you're unsure what some of the elements used here do, check out the full documentation here: https://instantview.telegram.org/docs
# Place the version at the beginning of template. We recommend always using the latest available version of Instant View.
~version: "2.0"
### STEP 1: Define which pages get Instant View and which don't
# That's easy because we only need IV pages for posts on the Telegram blog.
# This *condition* does the trick.
# ?path: /blog/.+
@imsus
imsus / .php_cs.laravel.php
Last active May 2, 2020 14:39 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'binary_operator_spaces' => [
'operators' => ['=>' => null]
],
'blank_line_after_namespace' => true,
/* eslint-disable camelcase */
const axios = require(`axios`)
const cheerio = require(`cheerio`)
const parseResponse = response => {
const $ = cheerio.load(response.data)
const scripts = $(`html > body > script`)
// Code smells #40 and #42
// I should verify why i get the script before the body tag
let id = 0
@imsus
imsus / README.md
Last active December 10, 2020 07:18
SOLVED: Laravel Mix Dynamic Import with Extract enabled that causes 0 bytes CSS

Motivation:

  1. I need Dynamic Import needed for lazyload Inertia Pages
  2. I also need Mix.extract() function enabled on webpack.mix.js in order to separate bundle based on vendor
  3. If we doing both without "mini-css-extract-plugin" app.css will be build with 0 bytes.

After tinkering for 2 hours, I find a way how to integrate "mini-css-extract-plugin" to laravel mix. Since this is the root cause of the "0 bytes of css" problem.

Info: My folder structure for resources

@imsus
imsus / workbox-config.js
Created May 24, 2020 05:35
Workbox configuration for Hugo
module.exports = {
cacheId: "imsus.dev-production",
globDirectory: "./public",
globPatterns: ["**/*.{css,js,eot,ttf,woff,woff2,otf}"],
swDest: "./public/service-worker.js",
modifyURLPrefix: {
"": "/",
},
clientsClaim: true,
skipWaiting: true,
<?php
namespace App\Services\Vite;
use Illuminate\Support\Str;
class ViteAssetsTransformer
{
public static function transform($entry)
{
@imsus
imsus / readme.md
Last active January 8, 2025 02:23
How to use Tailwindcss forms to unocss

Usage

  1. Add unocss-forms.ts somewhere in your code (example src/styles/unocss-forms.ts)
  2. Reference unocss-forms in unocss.config.ts preflight key. See code below for further changes
  3. Reload dev server
// unocss.config.ts

import {
@imsus
imsus / responsive-viewer.json
Last active September 28, 2023 10:22
Responsive Viewer Config (Chrome Extension)
{
"screens": [
{
"height": 768,
"highlighted": false,
"id": "b14b5495-0b85-4daf-973b-68ba4eaccdea",
"name": "<sm",
"userAgent": "Google Chrome",
"visible": true,
"width": 480