View AddyAddressLookupTest.php
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 | |
namespace Tests\Feature; | |
use App\Services\Addy\Models\AddressDetails; | |
use GuzzleHttp\Client; | |
use Tests\TestCase; | |
class AddyAddressLookupTest extends TestCase | |
{ |
View gulpfile.babel.js
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 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', () => { |
View ufw-setup.sh
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 | |
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 |
View blog-contactform.css
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
.response { | |
margin: 10px 0px; | |
padding:12px; | |
} | |
.response.success { | |
color: #4F8A10; | |
background-color: #DFF2BF; | |
} |
View blog-contactform.js
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
$(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); |
View ansible-playbook.yml
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
- 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
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
/* | |
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')); |
View nginx-install.sh
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 | |
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" |
View example
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 | |
$usersWithComments = Cache::remember('users', $minutes, function() | |
{ | |
return App\users::with('comments')->get(); | |
}); | |
// or | |
$users = App\users::with('comments')->get(); |
View example-queue.conf
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
[program:example-queue] | |
command=php artisan queue:work --queue=exmaple --tries=2 --daemon | |
directory=/var/www/example | |
stdout_logfile=/var/www/example/app/storage/logs/supervisor.log | |
stdout_logfile_maxbytes=50MB | |
stdout_logfile_backups=10 | |
stdout_capture_maxbytes=0 | |
stdout_events_enabled=false | |
// use 2 workers |
NewerOlder