Skip to content

Instantly share code, notes, and snippets.

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

Justin Cone justincone

🏠
Working from home
View GitHub Profile
@simonhamp
simonhamp / AppServiceProvider.php
Last active September 19, 2024 14:10
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@gilbitron
gilbitron / InvoicePaid.php
Created November 14, 2016 12:31
Convert the Laravel Spark invoice email to a notification email
<?php // app/Notifications/InvoicePaid.php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Laravel\Cashier\Invoice;
@woogist
woogist / woocommerce-customer-order-csv-export-add-additional-columns.php
Created February 6, 2014 03:28
WooCommerce Customer/Order CSV Export: Add additional columns
<?php
// add custom column headers
function wc_csv_export_modify_column_headers( $column_headers ) {
$new_headers = array(
'column_1' => 'Column 1',
'column_2' => 'Column 2',
// add other column headers here in the format column_key => Column Name
);
@korczis
korczis / deferredRequest.js
Last active August 22, 2017 20:05
Deferred wrapper of cherio request
var deferred = require('deferred'),
request = require('request'),
cheerio = require('cheerio');
var deferredRequest = function(url) {
var d = deferred();
request(url, function (err, resp, body) {
if(err) {
d.reject(new Error("Unable to fetch '" + url + "', reason: " + err));
@jakebresnehan
jakebresnehan / Simple-HTML5-Local-Storage.js
Created March 6, 2012 06:02
Simple HTML5 Local Storage example to hide a element
Need to include Modernizer (http://www.modernizr.com/) and jQuery (http://jquery.com/)
$(document).ready(function($){
if (Modernizr.localstorage) {
$('#hide-button').click(function(e){
localStorage.setItem('subscribed',true);
$('#sign-up-form,#hide-button').hide();
$('#hide-button').hide();