Skip to content

Instantly share code, notes, and snippets.

View spekkionu's full-sized avatar

Jonathan Bernardi spekkionu

View GitHub Profile
@spekkionu
spekkionu / contact.php
Created November 19, 2015 03:54
Contact From with AJAX
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Contact Us</title>
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
<script src='//www.google.com/recaptcha/api.js' async defer></script>
</head>
@spekkionu
spekkionu / breadcrumbs.sql
Created April 14, 2016 06:59
Get breadcrumbs for nested set
SELECT
GROUP_CONCAT(
ancestor.name
ORDER BY ancestor.lft ASC
SEPARATOR ' > '
),
child.*
FROM `categories` child
JOIN `categories` ancestor
ON child.lft >= ancestor.lft
@spekkionu
spekkionu / build.php
Created April 5, 2017 22:47
plates phar
<?php
$srcRoot = realpath(__DIR__."/vendor");
$buildRoot = realpath(__DIR__);
class MyRecursiveFilterIterator extends RecursiveFilterIterator {
public function accept() {
if(!$this->current()->isFile()){
return true;
}
@spekkionu
spekkionu / audio-player.js
Last active November 1, 2018 03:48
Audio player component
/**
* Copyright 2018 Jonathan Bernardi
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE