Skip to content

Instantly share code, notes, and snippets.

View kamaroly's full-sized avatar

Kamaro Lambert kamaroly

View GitHub Profile
/////////////////////////////////////////////////////////////////////////
// IF WE HAVE TOOBAR AND MENUBAR WE ASSUME THIS IS NOT FROM MOBILE APP //
/////////////////////////////////////////////////////////////////////////
if (window.toolbar.visible && window.menubar.visible) {
var appIcon = window.document.getElementById('app-icon');
appIcon.style.display = "block";
}
<?php
/**
* Add the field to the checkout
**/
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>';
@kamaroly
kamaroly / SftpServiceProvider.php
Created June 17, 2016 08:46 — forked from rtconner/SftpServiceProvider.php
Provider so you can add a 'sftp' connection in Laravel 5 filesystems.php - "Call to undefined method League\Flysystem\Filesystem::createSftpDriver"
<?php
namespace App\Providers;
use League\Flysystem\Sftp\SftpAdapter;
use Storage;
use League\Flysystem\Filesystem;
use Illuminate\Support\ServiceProvider;
/**
@kamaroly
kamaroly / ingest.php
Created March 7, 2016 08:48 — forked from lalinsky/ingest.php
Simple audio fingerprint matching in PHP
<?php
include "utils.php";
$fp = parse_fp($_GET['fp']);
$dbh = new PDO('mysql:host=localhost;dbname=fingerprint', 'fingerprint');
$dbh->beginTransaction();
$sth = $dbh->prepare("INSERT INTO fp (length) VALUES (?)");
@kamaroly
kamaroly / streamed.php
Created November 3, 2015 07:46 — forked from m4tthumphrey/streamed.php
Laravel response macro for streamed responses with seeking support
<?php
Response::macro('streamed', function($type, $size, $name, $callback) {
$start = 0;
$length = $size;
$status = 200;
$headers = [
'Content-Type' => $type,
'Content-Length' => $size,
@kamaroly
kamaroly / form.html
Last active August 29, 2015 14:24 — forked from gosseti/form.html
<form accept-charset="UTF-8" action="/payment" class="cardInfo" method="post">
<fieldset class="cardInfo__cardDetails">
<div class="form-row cardInfo__cc-num">
<label for="cc-num"><abbr title="required">*</abbr><span>Card Number</span></label>
<div class="cc-num__wrap">
<!-- using type="tel" because type="number" doesn’t pass HTML5 form validation with jQuery.payment formatting -->
<input id="cc-num" type="tel" class="paymentInput cc-num" placeholder="•••• •••• •••• ••••" autocompletetype="cc-number" required="required">
<span class="card" aria-hidden="true"></span>
@kamaroly
kamaroly / form.html
Last active August 29, 2015 14:20 — forked from gosseti/form.html
<form accept-charset="UTF-8" action="/payment" class="cardInfo" method="post">
<fieldset class="cardInfo__cardDetails">
<div class="form-row cardInfo__cc-num">
<label for="cc-num"><abbr title="required">*</abbr><span>Card Number</span></label>
<div class="cc-num__wrap">
<!-- using type="tel" because type="number" doesn’t pass HTML5 form validation with jQuery.payment formatting -->
<input id="cc-num" type="tel" class="paymentInput cc-num" placeholder="•••• •••• •••• ••••" autocompletetype="cc-number" required="required">
<span class="card" aria-hidden="true"></span>
/* Gmail style scrollbar */
::-webkit-scrollbar {
width: 12px
}
::-webkit-scrollbar-thumb {
border-width: 1px 1px 1px 2px
}
::-webkit-scrollbar-track {
border-width: 0
}