Skip to content

Instantly share code, notes, and snippets.

View kebalicious's full-sized avatar
being a star

Kebal kebalicious

being a star
View GitHub Profile
@devhammed
devhammed / countries.json
Created October 17, 2020 05:21
Countries with Name, Dial Code, Emoji Flag and ISO Code
[
{
"name": "Afghanistan",
"flag": "🇦🇫",
"code": "AF",
"dial_code": "+93"
},
{
"name": "Åland Islands",
"flag": "🇦🇽",

Converting Tailwind UI Alpine transitions to Vue transitions

After you copy a component from the Tailwind UI library and begin to adapt it from Vue JS to Alpine JS .. you may wonder what to do about the transitions. As I'm exploring this myself, I am documenting it for others in the same boat.

Things to be aware of:

  • Alpine calls the beginning and ending states "start" & "end"
  • Vue calls the beginning and ending states "from" and "to"
  • Alpine has inline "directives" ie x-transition:enter="classes"
  • Vue has a wrapper component that applies classes to the child
  • Alpine applies the classes you pass it for each state, :enter-start="class"
@ganapativs
ganapativs / iTerm2 + oh-my-zsh + Pure theme + zsh plugins setup.md
Last active June 23, 2024 10:41
iTerm2 + oh-my-zsh + Pure theme + zsh plugins setup
git log --all --grep="search text"
@mfd
mfd / GTWalsheimPro.css
Last active May 3, 2024 16:52
GT Walsheim Pro
@font-face {
font-family: GT Walsheim Pro;
src: local("GT Walsheim Pro Regular"),local("GTWalsheimProRegular"),url(GTWalsheimProRegular.woff2) format("woff2"),url(GTWalsheimProRegular.woff) format("woff"),url(GTWalsheimProRegular.ttf) format("truetype");
font-weight: 400;
font-style: normal
}
@font-face {
font-family: GT Walsheim Pro;
src: local("GT Walsheim Pro Bold"),local("GTWalsheimProBold"),url(GTWalsheimProBold.woff2) format("woff2"),url(GTWalsheimProBold.woff) format("woff"),url(GTWalsheimProBold.ttf) format("truetype");
@nmfzone
nmfzone / domain.com
Created April 15, 2017 10:36
NginX SSL Config for Laravel/Lumen using Let's Encrypt
server {
listen 80;
listen [::]:80;
server_name domain.com;
# Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
return 301 https://$host$request_uri;
}
@cdinu
cdinu / getxypercent.js
Created September 25, 2015 13:42
Get XY coordinates as percentages
// 1. Load an image in a new tab
// 2. Open JS console. Leave it open
// 3. Paste this
var s = document.createElement('script');
s.setAttribute('src','https://code.jquery.com/jquery-2.1.4.min.js');
document.head.appendChild(s);
// 4. Then paste this
var oldx = 0, oldy = 0;
@steveirl
steveirl / list_quarters.php
Last active December 21, 2021 20:09
Get a list of (date) quarters between two given dates. Return array of objects with information about each quarter
<?php
// get month name from number
function month_name($month_number){
return date('F', mktime(0, 0, 0, $month_number, 10));
}
// get get last date of given month (of year)
function month_end_date($year, $month_number){
@danrovito
danrovito / countrydropdown.html
Last active July 3, 2024 12:57
HTML Country Select Dropdown List
<label for="country">Country</label><span style="color: red !important; display: inline; float: none;">*</span>
<select id="country" name="country" class="form-control">
<option value="Afghanistan">Afghanistan</option>
<option value="Åland Islands">Åland Islands</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
@rahman541
rahman541 / ic_sample.php
Last active November 3, 2021 02:46
IC Number input validation on server side (PHP) using Regular Expression (Regex)
<?php
$ic = "123456-11-1111"; //default ic if not set
if(isset($_POST["ic"])){
$ic = $_POST["ic"];
}
$regex = '/^[0-9]{6}-[0-9]{2}-[0-9]{4}$/';
if (preg_match($regex, $ic)) {
echo 'Valid';
} else {