Skip to content

Instantly share code, notes, and snippets.

View nicekiwi's full-sized avatar
🍳
Living brunch to brunch.

Ezra nicekiwi

🍳
Living brunch to brunch.
View GitHub Profile
@nicekiwi
nicekiwi / modal.blade.php
Created April 10, 2024 23:31
Bootstrap 5 - Livewire Modal
@props(['open' => false, 'title', 'trigger', 'content'])
<div x-data="{
open: @js($open),
hide() { this.open = false },
show() { this.open = true },
whenOpen(func) { if (this.open) $nextTick(func) },
}">
<div
x-on:click="show()"
@nicekiwi
nicekiwi / AddyAddressLookupTest.php
Created December 5, 2019 06:19
Laravel Mockery
<?php
namespace Tests\Feature;
use App\Services\Addy\Models\AddressDetails;
use GuzzleHttp\Client;
use Tests\TestCase;
class AddyAddressLookupTest extends TestCase
{
@nicekiwi
nicekiwi / gulpfile.babel.js
Created March 7, 2017 13:45
New ES6 project with Babel, Browserify & Gulp + Bundling/Watching Multiple Files
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', () => {
#!/bin/bash
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
nicekiwi / blog-contactform.css
Last active December 26, 2015 09:58
CSS to power the frontend of my blog's contact form.
.response {
margin: 10px 0px;
padding:12px;
}
.response.success {
color: #4F8A10;
background-color: #DFF2BF;
}
@nicekiwi
nicekiwi / blog-contactform.js
Last active December 26, 2015 10:30
Code to power the frontend of my blogs Contact Form
$(document).ready(function () {
$('#contactForm').on('submit', function(event) {
// stop form submitting
event.preventDefault();
var form = $(this);
var button = form.find('button');
var responseBox = $('.response', form);
@nicekiwi
nicekiwi / ansible-playbook.yml
Created July 29, 2015 05:16 — forked from bhalothia/ansible-playbook.yml
register variables across plays
- 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
/*
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('http://myserver.com/testpost', compact('user_id'));
#!/bin/bash
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
nicekiwi / example
Last active August 29, 2015 14:22
Cache Model Example
<?php
$usersWithComments = Cache::remember('users', $minutes, function()
{
return App\users::with('comments')->get();
});
// or
$users = App\users::with('comments')->get();