Skip to content

Instantly share code, notes, and snippets.

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

All Unser Miranda queued

🏠
Working from home
  • Viçosa, Minas Gerais - Brasil
View GitHub Profile
@queued
queued / index.html
Created June 12, 2023 22:25 — forked from neisdev/index.html
Tailwind + Alpine | Searchable Cards
<!-- codepen of https://alpinetoolbox.com/examples/cards-search -->
<body class="bg-grey-100 px-3 font-sans leading-normal tracking-normal">
<div class="container pt-8 mx-auto" x-data="loadEmployees()">
<input x-ref="searchField" x-model="search" x-on:keydown.window.prevent.slash="$refs.searchField.focus()" placeholder="Search for an employee..." type="search" class="block w-full bg-gray-200 focus:outline-none focus:bg-white focus:shadow text-gray-700 font-bold rounded-lg px-4 py-3">
<div class="mt-4 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
<template x-for="item in filteredEmployees" :key="item">
<div class="flex items-center shadow hover:bg-indigo-100 hover:shadow-lg hover:rounded transition duration-150 ease-in-out transform hover:scale-105 p-3">
<img class="w-10 h-10 rounded-full mr-4" :src="`${item.profile_image}`" />
<div class="text-sm">
<p class="text-gray-900 leading-none" x-text="item.employee_name + ' (' + item.employee_age + ')'"
<?php
$now = 100.00;
$months = 12;
$monthly = 100.00;
$tax = 6.5;
if ($monthly) {
$result = ($monthly * (((1 + $tax / 100) ** $months) - 1) / ($tax / 100));
} else {
@font-face {
font-family: "Proxima Nova";
src: url(data:font/opentype;base64,d09GRgABAAAAAEywABIAAAAAg3QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEWU5BAAAGbAAAALgAAAGJNI0oHkZGVE0AAAGUAAAAHAAAABxdnq2WR0RFRgAAByQAAAA4AAAAQgSqBTxHUE9TAAAHXAAABCIAABH0zI0AF09TLzIAAAXUAAAAVwAAAGCAz3p9Y21hcAAASvgAAAG2AAAC5lCJVL9jdnQgAAABsAAAAB4AAAAeCkcLCmZwZ20AAAHQAAABsgAAAmUjtC+nZ2FzcAAAA4QAAAAIAAAACAAAABBnbHlmAAALgAAAO4sAAF8I3FzIU2hlYWQAAAOMAAAANQAAADb9TDtqaGhlYQAABiwAAAAgAAAAJA9PBsBobXR4AABHDAAAAh8AAANsqw8hfGxvY2EAAEksAAABuAAAAbhtqYQ8bWF4cAAABkwAAAAgAAAAIAIDAhpuYW1lAAADxAAAAawAAANRLIw+gnBvc3QAAErkAAAAEwAAACD/DQAocHJlcAAABXAAAABjAAAAdNUcAaMAAAABAAAAAMmJbzEAAAAAyRrF1wAAAADK+niN/pAAAAPGBTYBYADCANABNgE+AWgBmQDkAZIBkAFYAAB42l1Ru05bQRDdDQ+TBBJjg+RoU8xmQhrvhYYCJBBXF8XIdmM5QtqNXORiXMAHUCBRg/ZrBmgoKdKmQcgFUj6BT0BiZk2iKM3Ozuycc+bMknKk6l1a73nqnARSuNOg2abfDql2FuCedH21kZF28EDzzYxeuW7ff8VgM5pyRw2gvOct5SGjaSdQi/bU/za/guE+/2Qeg0FLM01PrZOQHkJgvhm3MPie0ay7/KQvWB0uBgNDimkq7vJzKuV/S3Outgibaxm9dnAmIj+ZBmhqpY1A0186pHo+jmIJctkw1gYTU9afZCL4ZjJd1VQtM751cJfszDt
@queued
queued / vuejs-php.md
Created August 4, 2018 16:52
VueJs and PHP
@queued
queued / PAGINATE.md
Created August 1, 2018 14:54
Slim Pagination

PHP Slim Pagination

Example pagination for slimphp/Slim. No extra classes needed.

In this exmaple I used the PHP Slim framework with Twig view templates. As fronted framework Semantic-UI with the Pagination Module is used. The shown scenarion is listing Blog posts.

Route (index.php)

$app->get('/posts', function(Request $req,  Response $res, $args = []) use ($cache) {
@queued
queued / LINK.txt
Created May 15, 2016 18:28
Ertheia client download link
public function timeAgo(\Datetime $then)
{
$now = new \Datetime('now');
$interval = $then->diff($now);
$points = array(
'y' => array('year', 'years'),
'm' => array('month', 'months'),
'd' => array('day', 'days'),

Animate the transformation of a mobile menu toggle into a cross

Animation for a mobile menu toggle. Three horizontal lines transform into a cross and back again. The top and bottom lines fall into the center, transforming into one line. The line(s) rotate clockwise, spawning a line at 45deg and stop at 135 deg, forming a cross. Demo: http://jsfiddle.net/SYYr5/7/

Annotations:

  • the animation uses four additional elements inside the a tag. This is not semantic, but at we can at least use elements without a semantic meaning, like div and span
  • using a div as a second container, we are able to apply a padding to our a tag
  • inTop/outTop, inMiddle/outMiddle and inBottom/outBottom are the same animation. This seemed to be the only way to 'restart' the animation.
  • Adding 180deg looks even better ;) but is a bit laggy sometimes :/
@queued
queued / array.php
Last active January 4, 2016 02:59
Dúvida - PHP Brasil
<?php
$array = ['Hello', 'Índice 1', 'Índice 2'];
$var1 = array_pop($array); // índice 2
$var2 = array_pop($array); // índice 1
<?php
/*
* .htaccess
* <IfModule mod_rewrite.c>
* RewriteEngine on
* RewriteCond %{REQUEST_FILENAME} !-d
* RewriteCond %{REQUEST_FILENAME} !-f
* RewriteRule ^(.*)\.(.+)\.(css|js)$ $1.$3 [L] # Strip out the version number
* </IfModule>