Skip to content

Instantly share code, notes, and snippets.

View jovanialferez's full-sized avatar

jovanialferez

  • Hoogly
  • Davao City, Philippines
View GitHub Profile
@jovanialferez
jovanialferez / Dockerfile
Last active March 7, 2023 18:22
Laravel docker-compose setup
FROM php:7.4-fpm-alpine
RUN docker-php-ext-install pdo pdo_mysql pcntl bcmath
RUN apk --no-cache add supervisor sudo
RUN apk --no-cache add $PHPIZE_DEPS \
&& pecl install xdebug \
&& docker-php-ext-enable xdebug
// #js-profile-pic-upload --> <input id='js-profile-pic-upload' type=file />
$('#js-profile-pic-upload').on('change', function () {
const supplierId = $(this).data('supplierId');
var form = new FormData();
form.append('photo', $(this)[0].files[0]);
$.ajax({
type: 'POST',
url: `/upload-photo`,
data: form,
FROM nginx:alpine
COPY nginx.conf /etc/nginx/nginx.conf
@jovanialferez
jovanialferez / RegisterController.php
Created December 11, 2018 00:40
bypass laravel auto-login on registration
/**
* Overridden to not auto-login user after registration.
*
* @inheritdoc
*/
public function register(Request $request)
{
$this->validator($request->all())->validate();
$user = $this->create($request->all());
@jovanialferez
jovanialferez / ubuntu-docker-setup-windows-10-wsl.md
Last active December 8, 2018 14:15
my windows 10 dev setup
@jovanialferez
jovanialferez / app.scss
Last active May 30, 2018 05:51
Using custom icons in Ionic 2 or 3
@import '../theme/icons'; // that icons.scss above
@include makeIcon(mb-orders, '\e92e');
@include makeIcon(mb-home, '\e900');
@include makeIcon(mb-account, '\e901');
server {
listen 80;
root /var/www;
index index.php index.html;
proxy_read_timeout 300;
client_max_body_size 1024M;
location / {
version: '2'
services:
mysql:
build: ./mysql
volumes_from:
- volumes_data
ports:
- "3306:3306"
environment:
#!/bin/sh
cd /tmp
mkdir vpnht
cd vpnht
cat <<EOF > vpnht.conf
client
dev tun
proto udp
resolv-retry infinite
nobind
<?php
namespace common\models;
use Yii;
use yii\behaviors\BlameableBehavior;
use yii\behaviors\TimestampBehavior;
use yii\imagine\Image;
/**