This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Route::filter('after', function($response) | |
{ | |
if (($requested_type = Input::get('datagrid_download_as', false)) !== false && isset($response->content->data['datagrid'])) | |
{ | |
$original_datagrid = $response->content->data['datagrid']; | |
$requested_class = '\\UI\\DataGrid\\'.strtoupper($requested_type); | |
if (class_exists($requested_class) === false) | |
{ | |
// return the original response, we have no point on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (isset($_POST['opmerkingen']) && !empty($_POST['opmerkingen'])) | |
{ | |
$note = new Moneybird\Invoice_History(array( | |
'description' => 'Opmerking vanaf de website: '.$_POST['opmerkingen'], | |
)); | |
$note->save($invoiceService, $invoice); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* returns an array of unique items of meta_value, this was originally | |
* built for a filter machanism. | |
* | |
* @param string $post_type example: post | |
* @param string $meta_key example: _wp_page_template | |
* @return array | |
*/ | |
function get_unique_meta($post_type, $meta_key) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function filesize_formatted($path, $rounding = 2) | |
{ | |
$size = filesize($path); | |
$units = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); | |
$power = $size > 0 ? floor(log($size, 1024)) : 0; | |
return number_format($size / pow(1024, $power), $rounding, '.', ',') . "\xC2\xA0" . $units[$power]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* test - score: 4 | |
* tESt - score: 4 | |
* TeSt - score: 4 | |
* TeS342 - score: 12 | |
* T34@$sTD - score: 72 | |
* :saR%8jmc9UjeK - score: 504 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* For modern browsers | |
* 1. The space content is one way to avoid an Opera bug when the | |
* contenteditable attribute is included anywhere else in the document. | |
* Otherwise it causes space to appear at the top and bottom of elements | |
* that are clearfixed. | |
* 2. The use of `table` rather than `block` is only necessary if using | |
* `:before` to contain the top-margins of child elements. | |
*/ | |
.cf:before, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "compass/utilities/sprites"; // Include compass sprite helpers | |
@import "compass/css3/background-size"; // Include helper to calc background size | |
@mixin retina-sprite($name, $hover: false, $active: false) { | |
@include _retina-sprite($name, $sprites, $sprites2x, $hover, $active); | |
} | |
@mixin _retina-sprite($name, $sprites, $sprites2x, $hover, $active, $dimensions: true, $pad: 0) { | |
@if $dimensions == true { | |
@include sprite-dimensions($sprites, $name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I needed some way to take a picture using the getUserMedia() API, | |
// save it to a canvas and then upload it to a server using a multipart | |
// form for it to be validateable by Laravel. | |
// | |
// the function that returns a blob | |
// | |
function toBlob(dataURL) { | |
var array, binary, i; | |
binary = atob(dataURL.split(',')[1]); | |
array = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
files=$(git diff --cached --name-only | grep '\.jsx\?$') | |
# Prevent ESLint help message if no files matched | |
if [[ $files = "" ]] ; then | |
exit 0 | |
fi | |
failed=0 | |
for file in ${files}; do |
OlderNewer