Skip to content

Instantly share code, notes, and snippets.

View willyarisky's full-sized avatar
🇮🇩
Working from paradise

Willy Arisky willyarisky

🇮🇩
Working from paradise
View GitHub Profile
@willyarisky
willyarisky / compiler.php
Created October 18, 2024 23:58
Compile SCSS files with PHP / SCSS PHP Compiler
<?php
require 'resources/vendor/autoload.php';
use ScssPhp\ScssPhp\Compiler;
$scss = new Compiler();
// Set the import paths for Bootstrap SCSS and other directories
$scss->setImportPaths('resources/scss');
@willyarisky
willyarisky / websitedownloader.bash
Created August 22, 2021 23:41
wget command to download website as html
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains nebula-innovations.com \
--no-parent \
nebula-innovations.com
@willyarisky
willyarisky / moment-js-timezone-list.text
Created May 24, 2021 21:38
List of all supported timezone in moment.js
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
@willyarisky
willyarisky / nl2br.js
Created March 31, 2021 02:07
Nuxt.js custom plugin for converting new line to tag <br>
export default ({ app }, inject) => {
const nl2br = (str) => {
if (typeof str === 'undefined' || str === null) {
return '';
}
return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + '<br>' + '$2');
}
inject('nl2br', nl2br)
@willyarisky
willyarisky / package.json
Created September 7, 2020 15:41 — forked from tofikhidayatxyz/package.json
Simpe laravelmix config for auto prefixer
let mix = require('laravel-mix');
require('laravel-mix-purgecss');
require('laravel-mix-polyfill');
const path = require('path')
mix.options({
processCssUrls: false, // enable this if need auto process css url
postCss: [
require('autoprefixer')({
{"lastUpload":"2021-01-12T07:47:31.587Z","extensionVersion":"v3.4.3"}
@willyarisky
willyarisky / cron
Created April 5, 2020 00:13
Cron for auto enter license trial filemanager vestacp ILOVEREO
*/5 * * * * sed -i 's/FILEMANAGER_KEY='\'''\''/FILEMANAGER_KEY='\''ILOVEREO'\''/g' /usr/local/vesta/conf/vesta.conf
@willyarisky
willyarisky / alerts.blade.php
Last active October 28, 2019 00:15
Component to show push message laravel
@if (session('success'))
<div class="alert alert-success alert-dismissible fade show" role="alert">
{{ session('success') }}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
@endif
@if (session('failed'))
<div class="alert alert-danger alert-dismissible fade show" role="alert">
@willyarisky
willyarisky / app.js
Created July 30, 2019 15:56
jQuery ajax upload with progress bar
$('#photo-uploader').change((e) => {
e.preventDefault();
$.ajax({
url: '/photo/upload',
type: 'POST',
processData: false,
contentType: false,
data: new FormData($('#print-order-form')[0]),
beforeSend: () => {
@willyarisky
willyarisky / .htaccess
Created May 1, 2019 02:32
Redirect to www and https
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Force SSL
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R,L]