Skip to content

Instantly share code, notes, and snippets.

View Braunson's full-sized avatar

Braunson Yager Braunson

View GitHub Profile
@Braunson
Braunson / cashier.php
Created December 3, 2014 23:44
Extending the Laravel package Cashier for creating an customer without a credit card
namespace Acme\V1\Billing;
// BillableInterface.php
use Laravel\Cashier\BillableInterface as CashierInterface;
interface BillableInterface extends CashierInterface {
}
@Braunson
Braunson / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Braunson
Braunson / gist:42d2b507a160c5bb38f6
Last active August 29, 2015 14:12
Quick write to file with date/time, very crude.
function logToFile($msg) {
$filename = 'logfile.log';
if(is_array($msg)){
file_put_contents($filename, print_r($msg, true), FILE_APPEND);
} else {
$fd = fopen($filename, "a");
$str = "[" . date("Y/m/d h:i:s", mktime()) . "] " . $msg;
fwrite($fd, $str . "\n");
fclose($fd);
input {
height: 34px;
width: 100%;
border-radius: 3px;
border: 1px solid transparent;
border-top: none;
border-bottom: 1px solid #DDD;
box-shadow: inset 0 1px 2px rgba(0,0,0,.39), 0 -1px 1px #FFF, 0 1px 0 #FFF;
}
@Braunson
Braunson / gist:a6ed85cc3d189dce2ce9
Created February 8, 2015 20:48
Custom jQuery Validator Methods/Rules for select drop downs.
// Custom validator method
$.validator.addMethod("valueNotEqualsVal", function(value, element, arg){
return arg != value;
}, "Value must not equal arg.");
$.validator.addMethod("valueNotEqualsTxt", function(value, element, arg){
return return arg != jQuery(element).find('option:selected').text();
}, "Value must not equal arg.");
// Usage
@Braunson
Braunson / gist:8aa2e0084098c84f0d8f
Created February 8, 2015 21:03
jQuery $.browser is deprecated, here's a drop in working fix to resolve $.browser errors so you can continue using $.browser.
(function( $ ){
jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
/(msie) ([\w.]+)/.exec( ua ) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || [];
return {
@Braunson
Braunson / dataTables.less
Created February 9, 2015 20:19
DataTables 1.10.4 converted to LESS
//
// Colour customisation
//
// Border between the header (and footer) and the table body
@table-header-border: 1px solid #111111;
// Border of rows / cells
@table-body-border: 1px solid #dddddd;
@Braunson
Braunson / index.php
Last active August 29, 2015 14:15 — forked from elsassph/index.php
<?php
// first create a new voice chat room:
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query(array()),
)

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {