Skip to content

Instantly share code, notes, and snippets.


Henner Renardi Setyono hrsetyono

View GitHub Profile
hrsetyono / package.json
Last active Jul 10, 2022
Vite for WordPress (work in progress, hot reload not yet working)
View package.json
"name": "my-app",
"private": true,
"repository": {
"type": "git",
"url": "git+"
"dependencies": {},
"devDependencies": {
"sass": "^1.53.0",
hrsetyono /
Last active May 14, 2021
Folder Management in Windows with CLI

Remove all empty directories

for /f "delims=" %d in ('dir /s /b /ad ^| sort /r') do rd "%d"

7Zip - Compress each directories into its own zip

Require 7zip installation to be added to PATH

hrsetyono /
Created Jan 2, 2021
Clone Private Github repo to Digital Ocean (with Password)

Warning: This only works if you enable Password authentication in Digital Ocean.

If you want to use Key authentication, most tutorials in Google already cover that.

Step 1 - Create deploy.yml

In your repo, create .github/workflow/deploy.yml containing this:

name: Deploy via SSH
View surprised-pikachu.jpg
View timber.php
class MyTimber extends TimberSite {
function __construct() {
add_filter( 'timber_context', [$this, 'add_to_context'] );
add_filter( 'get_twig', [$this, 'add_to_twig'] );
// Add Global variable
function add_to_context( $context ) {
hrsetyono / app.js
Last active Jul 11, 2019
JavaScript - Create one letter favicon dynamically
View app.js
* Automatically generate favicon using the first letter of a text
function createFavicon( text, bgColor = '#004ea2', textColor = '#ffffff' ) {
var favicon = document.getElementById('favicon');
var faviconSize = 128;
var canvas = document.createElement( 'canvas' );
canvas.width = faviconSize;
canvas.height = faviconSize;
hrsetyono / functional-classes-loop.scss
Last active Nov 15, 2018
Sass - Mixin to create functional classes from a Map
View functional-classes-loop.scss
$_name: null !global;
$_value: null !global;
// Custom loop to apply the name and value
@mixin _loop( $list, $responsive: true ) {
@each $name, $value in $list {
$_name: $name !global;
$_value: $value !global;
hrsetyono / animate-on-scroll.css
Last active Oct 31, 2018
Start animation on scroll
View animate-on-scroll.css
[data-animate] { visibility: hidden !important; }
.animate { visibility: visible !important; animation-duration: 1s; animation-fill-mode: both; }
.animate.fadeIn { animation-name: fadeIn; }
@keyframes ( fadeIn ) {
0% { opacity: 0; }
100% { opacity: 1; }
hrsetyono / functions.php
Last active Jul 2, 2018
PHP Google Calendar API with Service Accounts
View functions.php
If you came here from my WP Plugin (, you don't need to require the API Client.
Aside from that, you need to download the client from
Put it in this directory, then uncomment the require_once code below.
// require_once 'vendor/autoload.php';
hrsetyono / tasker.xml
Last active Oct 3, 2020
FEH Tasker - GHB auto battle lunatic
View tasker.xml
<TaskerData sr="" dvi="1" tv="5.1m">
<Task sr="task2">
<Action sr="act0" ve="7">
<Int sr="arg0" val="0"/>