Skip to content

Instantly share code, notes, and snippets.

View sudomabider's full-sized avatar

Veo Chen sudomabider

  • Christchurch, NZ
View GitHub Profile
@sudomabider
sudomabider / docker-compose.yml
Last active October 29, 2018 21:24
haproxy example
version: '3'
services:
haproxy:
image: haproxy:alpine
restart: 'unless-stopped'
logging:
driver: 'json-file'
options:
max-size: 100k
@sudomabider
sudomabider / Vagrantfile
Created April 15, 2018 06:43
vagrant docker box setup
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
@sudomabider
sudomabider / convert-line-endings.sh
Last active September 30, 2017 22:22
convert all line endings
find . ! -path '*.git*' ! -path '*/vendor/*' ! -path '*/node_modules/*' -type f -print0 | xargs -0 dos2unix
@sudomabider
sudomabider / questions.md
Last active November 9, 2017 23:59
Interesting coding questions

What will it be?

Javascript

// Without running these in the browser, can you tell what each of the following would return?
['1', '2', '3', '4'].map(parseInt);

(new Array(2)).map(function() {
 return 1;
@sudomabider
sudomabider / _helper.scss
Created May 8, 2017 22:14
commonly used sass spacing helpers (bootstrap-4 style)
@mixin margin-helper($level, $spacing) {
.m-#{$level} {margin: #{$spacing}!important;}
.mx-#{$level} {margin-left: #{$spacing}!important;margin-right: #{$spacing}!important;}
.my-#{$level} {margin-top: #{$spacing}!important;margin-bottom: #{$spacing}!important;}
.mt-#{$level} {margin-top: #{$spacing}!important;}
.mb-#{$level} {margin-bottom: #{$spacing}!important;}
.ml-#{$level} {margin-left: #{$spacing}!important;}
.mr-#{$level} {margin-right: #{$spacing}!important;}
}
@sudomabider
sudomabider / RouteServiceProvider.php
Last active October 14, 2016 00:44
set guard paramter on route without auth
<?php
namespace App\Providers;
use App\Modules\Payment\Entities\PaymentMethod;
use App\Modules\Shipping\Entities\ShippingOption;
use App\Modules\Variant\Entities\VariantOption;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Routing\Router;
@sudomabider
sudomabider / install-chinese-font.sh
Created September 19, 2016 01:05
install chinese system fonts in ubuntu vagrant box to help with phantomJS screen capture
sudo apt-get install fonts-arphic-ukai fonts-arphic-uming fonts-ipafont-mincho fonts-ipafont-gothic fonts-unfonts-core