Skip to content

Instantly share code, notes, and snippets.

Living brunch to brunch.

Ezra Sharp nicekiwi

Living brunch to brunch.
View GitHub Profile
nicekiwi / AddyAddressLookupTest.php
Created December 5, 2019 06:19
Laravel Mockery
View AddyAddressLookupTest.php
namespace Tests\Feature;
use App\Services\Addy\Models\AddressDetails;
use GuzzleHttp\Client;
use Tests\TestCase;
class AddyAddressLookupTest extends TestCase
nicekiwi / gulpfile.babel.js
Created March 7, 2017 13:45
New ES6 project with Babel, Browserify & Gulp + Bundling/Watching Multiple Files
View gulpfile.babel.js
import gulp from 'gulp';
import sourcemaps from 'gulp-sourcemaps';
import buffer from 'gulp-buffer';
import uglify from 'gulp-uglify';
import tap from 'gulp-tap';
import browserify from 'browserify';
import babel from 'babelify';
gulp.task('build', () => {
apt-get -y update
# install the firewall
echo 'Installing UFW'
apt-get install -y ufw
echo 'Configuring UFW'
# disable IPv6
# sed -i "s/IPV6=yes/IPV6=no/" /etc/default/ufw
nicekiwi / blog-contactform.css
Last active December 26, 2015 09:58
CSS to power the frontend of my blog's contact form.
View blog-contactform.css
.response {
margin: 10px 0px;
.response.success {
color: #4F8A10;
background-color: #DFF2BF;
nicekiwi / blog-contactform.js
Last active December 26, 2015 10:30
Code to power the frontend of my blogs Contact Form
View blog-contactform.js
$(document).ready(function () {
$('#contactForm').on('submit', function(event) {
// stop form submitting
var form = $(this);
var button = form.find('button');
var responseBox = $('.response', form);
nicekiwi / ansible-playbook.yml
Created July 29, 2015 05:16 — forked from bhalothia/ansible-playbook.yml
register variables across plays
View ansible-playbook.yml
- vars:
# Extra vars from Rundeck for partition type
partition: "{{ partition }}"
# For 'nmctl ps' wrapper - Some deployment validation
number_of_tries: 5
sleep_between_tries: 60
hosts: "app-{{ partition }}[0]" # Canary
View gist:a8b7f8216b0bf959fcd5
public function openPaymentPage(Request $request) {
$user_id = $request->json('user_id');
// how to redirect post another server with paramters?
// i cant find any solution with googling..
// is it possible?
return redirect()->to('', compact('user_id'));
nginx=stable # use nginx=development for latest development version
add-apt-repository ppa:nginx/$nginx
apt-get update -y
apt-get install -y nginx
echo "Nginx Installed"
nicekiwi / example
Last active August 29, 2015 14:22
Cache Model Example
View example
$usersWithComments = Cache::remember('users', $minutes, function()
return App\users::with('comments')->get();
// or
$users = App\users::with('comments')->get();
nicekiwi / example-queue.conf
Created May 28, 2015 04:29
Supervisor Laravel Queue Example
View example-queue.conf
command=php artisan queue:work --queue=exmaple --tries=2 --daemon
// use 2 workers