Skip to content

Instantly share code, notes, and snippets.

View ipabz's full-sized avatar
🏠
Working from home

Ivan Clint Acedillo Pabelona ipabz

🏠
Working from home
View GitHub Profile
@ipabz
ipabz / ubuntu-20.04-macbook-pro.md
Created April 25, 2024 01:30 — forked from johnjeffers/ubuntu-20.04-macbook-pro.md
Ubuntu 20.04 on a 15" Retina MacBook Pro (Mid-2014)

Ubuntu 20.04 on a 15" Retina MacBook Pro (Mid-2014)

These are notes from my efforts to get Ubuntu 20.04 installed on my older MacBook Pro. I'm making this gist public in the hopes that it's helpful to others.

I did a Minimal install, but selected the option to install additional 3rd-party drivers.

Wifi doesn't work during the install (because it requires a 3rd-party driver), so you won't be able to choose to download updates while installing. No big deal, run a software update after the install.

The installer takes about 25 minutes to complete. Post-install, most things work. The only driver I had to manually install was for the FaceTime camera. More on that below.

@ipabz
ipabz / valet.conf
Created August 13, 2019 09:02 — forked from poul-kg/valet.conf
CORS Rules for Laravel Valet Nginx
# To enable CORS you should add lines with CORS rules below to your valet.conf file
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory
# after you edit your valet.conf do not forget to execute `valet restart`
server {
listen 80 default_server;
root /;
charset utf-8;
client_max_body_size 128M;
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
import 'rxjs/add/observable/throw';
import { Observable } from 'rxjs/Observable';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { AppError } from '../errors/app-error';
@ipabz
ipabz / gist:7dd1ab40683e63aae28432a76f590766
Created March 20, 2018 11:20 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@ipabz
ipabz / Repository.stub
Created July 12, 2017 13:52
Repository
<?php
namespace Backfence\Repositories;
use Illuminate\Database\Eloquent\Model;
use Backfence\Contracts\YourClassNameInterface;
class YourClassName extends Repository implements YourClassNameInterface
{
protected $model;
@ipabz
ipabz / find_state.php
Created September 2, 2016 06:30 — forked from henare/find_state.php
Function to determine Australian state from a postcode, from http://waww.com.au/ramblings/determine-state-from-postcode-in-australia
/**
* Returns the state for a postcode.
* eg. NSW
*
* @author http://waww.com.au/ramblings/determine-state-from-postcode-in-australia
* @link http://en.wikipedia.org/wiki/Postcodes_in_Australia#States_and_territories
*/
function findState($postcode) {
$ranges = array(
'NSW' => array(
@ipabz
ipabz / canvas-upload.php
Created April 21, 2016 13:40 — forked from fazlurr/canvas-upload.php
Function to save base64 image to png with PHP
<?php
// requires php5
define('UPLOAD_DIR', 'images/');
$img = $_POST['img'];
$img = str_replace('data:image/png;base64,', '', $img);
$img = str_replace(' ', '+', $img);
$data = base64_decode($img);
$file = UPLOAD_DIR . uniqid() . '.png';
$success = file_put_contents($file, $data);
print $success ? $file : 'Unable to save the file.';