Skip to content

Instantly share code, notes, and snippets.

@ejabu
ejabu / mp4-to-gif.bash
Created January 18, 2022 04:57 — forked from ToniRV/mp4-to-gif.bash
Convert MP4 to high-quality GIF
#!/usr/bin/env python
import sys
import os
import shutil
import subprocess
import argparse
# Group of Different functions for different styles
if sys.platform.lower() == "win32":

---Tutorial

pyenv install --list | grep 3.8

3.8.0
3.8-dev
3.8.1
3.8.2
@ejabu
ejabu / lunacy-curved-line.js
Created June 13, 2021 08:24
Convert straight line to curved Line Lunacy
function validateLayer(layer) {
if (layer.shapeType != "Custom") {
return false;
}
if (layer.points.length != 2) {
UI.message("Only arrows consist of two point will be processed");
return false;
}
return true;
}
@ejabu
ejabu / OtpModal.jsx
Last active July 11, 2025 20:48
Apollo Otp Timer
const OtpModal = ({ modal, toggle, phoneNumber = '', successCb }) => {
const [otp, setOtp] = useState('');
const [timer, setTimer] = useState(10);
const [hasResendOtp, setHasResendOtp] = useState(false);
const [errorMessage, setErrorMessage] = useState('');
useEffect(() => {
const interval = setInterval(() => {
setTimer((timer) => {
if (timer === 1 || timer === 0) {

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@ejabu
ejabu / good-theme-vscode.md
Created February 22, 2021 11:44
Github Light Theme Setup
/* ----------------------------------------------------------------------------------------------------
Super Form Reset
A couple of things to watch out for:
- IE8: If a text input doesn't have padding on all sides or none the text won't be centered.
- The default border sizes on text inputs in all UAs seem to be slightly different. You're better off using custom borders.
- You NEED to set the font-size and family on all form elements
- Search inputs need to have their appearance reset and the box-sizing set to content-box to match other UAs
@ejabu
ejabu / .htaccess
Last active July 25, 2020 18:01
HT Access Apache
GNU nano 4.8 /var/www/html/dist/.htaccess
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.html [NC]
RewriteRule ^ %1 [R,L,NC]
@ejabu
ejabu / cadastro_controller.dart
Created July 22, 2020 04:21
lib/app/modules/cadastro/cadastro_controller.dart
telefoneValidateOld(value) =>
value.length < 11 ? 'Insíra um número válido' : null;
telefoneValidate(String value) {
if (value.isNotEmpty) {
return value.length < 11 ? 'Insíra um número válido' : null;
}
return null;
}
@ejabu
ejabu / Halaman Ecommerce render XML template
Last active July 1, 2020 04:26
Override Controller Odoo
from odoo import http
from odoo.addons.http_routing.models.ir_http import unslug
from odoo.http import request
from odoo.addons.web import Home
class EcommercePage(Home):
@http.route(['/'], type='http', auth="public", website=True)
def halaman_page(self, **post):
barang_ids = request.env['barang.dagang'].sudo().search([])