Skip to content

Instantly share code, notes, and snippets.

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

A. Dzulfikar Adi Putra superpikar

🏠
Working from home
View GitHub Profile
@echr
echr / Whatsapp Botman Driver
Last active May 29, 2023 13:37
Simple Botman Whatsapp Driver
<?php
namespace Drivers\Whatsapp;
use BotMan\BotMan\Exceptions\Base\DriverException;
class WhatsappConnectionException extends DriverException
{
}
{# Bad: Messy and Hard to Follow #}
{% if link %}
<a href="/recipes/cookies">
{% endif %}
<span>Cookies</span>
{% if link %}
</a>
{% endif %}
{# Good: Clean & Clear #}
@ouelletv
ouelletv / socialSharePopups.js
Created August 1, 2018 13:58 — forked from josephabrahams/socialSharePopups.js
Facebook & Twitter Share Popup Windows
export default function() {
document.querySelectorAll('.js-share-facebook-link').forEach(function(el){
el.addEventListener('click', function(e){
var href = e.target.href;
e.preventDefault();
window.open(href, "Facebook", "toolbar=no,location=0,status=no,menubar=no,scrollbars=yes,width=600,height=400,resizable=1");
})
});
@terdelyi
terdelyi / craft_validate_public_user_registration.php
Last active September 11, 2021 03:18
CraftCMS 3 - Extending the validation on the public user registration form
<?php
use Craft;
use craft\base\Element;
use craft\elements\User;
use craft\events\ModelEvent;
use yii\base\Event;
@mrmartineau
mrmartineau / stimulus.md
Last active May 12, 2024 04:35
Stimulus cheatsheet
@justsml
justsml / fetch-api-examples.md
Last active February 24, 2024 18:05
JavaScript Fetch API Examples
@javilobo8
javilobo8 / download-file.js
Last active May 27, 2024 21:00
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@aaronwaldon
aaronwaldon / 1) readme.md
Last active March 24, 2023 14:25
How to set up Gulp for Craft CMS. Includes SASS compilation and minification, JavaScript minification, livereloading, and browser sync.

How to set up Gulp with a Craft CMS project

I freaking love working with technologies like Gulp, and wanted to share how to get my current Craft front-end workflow set up. With a few tweaks, this can also be used with virtually any other sites (I've used it with Laravel, static sites, ExpressionEngine, etc).

Project Directory Structure

  • project root/
    • craft/
      • templates/
  • (your craft template files)
@EvanWillms
EvanWillms / app.ts
Created April 10, 2016 19:45
Allow Ionic2 keyboard to open without pushing or scrolling content
// Minimum viable app.ts pulled from https://github.com/driftyco/ionic2-starter-blank/tree/41b4da8329636a95ab05d2579efd3a1527d2e830
// This snapshot is likely ionic-angular@2.0.0-beta.4 compatable
import 'es6-shim';
import {App, Platform} from 'ionic-angular';
import {StatusBar} from 'ionic-native';
import {HomePage} from './pages/home/home';
@App({
template: '<ion-nav [root]="rootPage"></ion-nav>',
@rifki
rifki / host
Last active January 22, 2022 17:27
Blokir Iklan Speedy dari situs v3.mercusuar.uzone.id
Ini adalah cara untuk memblockir iklan speedy jika kita salah ketik url website,
lalu telkom akan mengarahkan ke situs http://v3.mercusuar.uzone.id/?url=kamusalahketikurl.com
# Windows User
=====================
1. Edit file hosts C:\Windows\System32\Drivers\etc\hosts menggunakan notepad
2. Tambahkan seperti berikut:
127.0.0.1 v3.mercusuar.uzone.id # block telkom redirect
127.0.0.1 118.97.116.10
127.0.0.1 mercusuar.uzone.id