Skip to content

Instantly share code, notes, and snippets.

View jpalala's full-sized avatar
🎯
Focusing

Jose Palala jpalala

🎯
Focusing
View GitHub Profile
@jpalala
jpalala / fatmodel.php
Created April 21, 2019 23:41
idea for a fat model in laravel for a spa
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Fat extends Model
{
public function all() {
$sponsors = DB::select(DB::raw("SELECT * FROM sponsors LIMIT 10"));
@jpalala
jpalala / required.md
Created April 19, 2019 04:51
installing laravel - php extensions needed

Requirements

Run to install mbstring and other things for laravel

$ apt install php-mbstring php-intl php-xml php-curl

php_composer.install.sh:

@jpalala
jpalala / Virtual Blocks on Nginx.md
Created December 28, 2018 05:50 — forked from santoshachari/Virtual Blocks on Nginx.md
Setup additional sites on Nginx

Inspired and edited from this Digital Ocean tutorial.

Follow the steps on this gist to setup a LEMP stack with PHP 7.0.

The steps assume Nginx has been configured correctly.

Setup the root directories

For the domains example.com and test.com, create the folders.

@jpalala
jpalala / entry.js
Created December 25, 2018 11:55
lightweight profiles fetch renderer
const octo = require('octokat')(/* Config options would go here */)
const _ = require('underscore');
const persons = require('./personsofinterest.json');
let t1 = _.template("Hello <%=user%>!");
persons.forEach(function(person) {
console.log(t1({ user: person.username}));
});
@jpalala
jpalala / instructions.md
Last active November 17, 2018 02:41
stackoverflow - installing old php5.6 on ubuntu 16.04

Step 1: Remove all the stock php packages

List installed php packages with:

$>   dpkg -l | grep php| awk '{print $2}' |tr "\n" " "
@jpalala
jpalala / letsencrypt_2018.md
Created November 10, 2018 11:07 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@jpalala
jpalala / lemp-setup.debian.md
Last active November 2, 2018 15:41
lemp-setup on debian
@jpalala
jpalala / dockage.md
Created October 26, 2018 12:20
dockage
  • docker pull dockage/alpine-nginx-php-fpm
  • docker run dockage/alpine-nginx-php-fpm
  • docker ps
  • docker exec -it sh
@jpalala
jpalala / alpine-linux-docker.md
Created October 26, 2018 11:37
alpine installation of php notes
  • apk update && apk upgrade
  • apk add php7 php7-fpm
  • apk add php7-opcache
  • apk add php7-gd php7-mysqli php7-zlib php7-curl