Skip to content

Instantly share code, notes, and snippets.

View jesseleite's full-sized avatar

Jesse Leite jesseleite

View GitHub Profile
@jesseleite
jesseleite / block.com
Last active August 29, 2015 14:16
site setup on server example
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
root /var/www/example.com/public;
index index.php index.html index.htm;
charset utf-8;
@jesseleite
jesseleite / blog_semantics-and-frontend.md
Last active August 29, 2015 14:16
"Semantics" & Front-End

For several years now, many of us have been trying to keep our HTML as pure as possible. We did away with the inline style attribute (with good reason, as it was a maintenance nightmare), and we only added class attributes when absolutely necessary. CSS Zen Garden taught us that external stylesheets were cool, and that separation of concern was a good thing. "Semantic markup" became the new catch phrase.

Take the Bootstrap framework for example. Many criticize Bootstrap, claiming it's class-heavy CSS implementation taints their holy markup with too many CSS classes. However, I'd like to challenge your thinking on this. Why is Bootstrap hated? Does it really violate the concept of semantics? I would suggest most of Bootstrap's class names are semantic (ie. .form, .form-group, .btn, .btn-default, .btn-success, etc.) because they don't define the styles, but rather they point to our intended styles in plain English. This lends itse

@jesseleite
jesseleite / gist:fb96ba0f47f74f9e83e6
Created July 28, 2015 01:10
Slugify using Model observer.
Job::creating(function ($object) {
$slug = str_slug($object->title);
$exists = $object->where('title_slug', $slug)->orWhere('title_slug', 'like', $slug.'-%')->get();
$object->title_slug = $exists->count() == 0 ? $slug : $slug . '-' . $exists->count();
});
for voice in Whisper; do say "Every breath you take, every move you make, every bond you break, every step you take, I'll be watching you. I'll be watching you. I'll be watching you." -v ${voice}; done
@jesseleite
jesseleite / AuthorizesRequestsWithoutUser.php
Last active March 5, 2016 02:49
Authorize without authenticated user.
<?php
namespace App\Helpers;
use Illuminate\Contracts\Auth\Access\Gate;
use Illuminate\Auth\Access\AuthorizationException;
trait AuthorizesRequestsWithoutUser
{
/**
@jesseleite
jesseleite / job.md
Last active March 12, 2016 02:10
RoomRoster Intermediate to Senior Laravel Developer

Intermediate to Senior Laravel Developer

Who we are

RoomRoster is looking for full-time intermediate to senior Laravel developers to work on our product team. With over 20 years experience in sports event management, and a focus on the youth sport tournament market, RoomRoster was founded with one simple objective:

To create a valuable system for tournament directors to help streamline their event while delivering a consistent experience to their participants.

Must be willing to work on-site in London, Ontario, Canada.

<?php
namespace App\DB\Listeners;
class Cascade
{
/**
* Trigger cascade function on Eloquent Model if defined in softdeletes config.
* @param object $model Eloquent Model
-- The following is a script to bring back VI mode in Sierra.
-- See: https://gist.github.com/juanmiret/81a21a5ae8d6b6061b0a4e72a8be61b2
local module = {}
module.debugging = false -- whether to print status updates
local eventtap = require "hs.eventtap"
local event = eventtap.event
local inspect = require "hs.inspect"
@jesseleite
jesseleite / sendString.js
Last active March 26, 2018 00:17
Digital Ocean console sendString() for pasting
var sendString = (function(rfb, force, sendDelay) {
sendDelay = sendDelay || 25;
var _q = [];
var _qStart = function() {
var chr = _q.shift();
if (chr) {
rfb.sendKey(chr);
setTimeout(_qStart, sendDelay);
}
};
@jesseleite
jesseleite / # php@7.1 - 2018-03-31_21-54-39.txt
Created April 2, 2018 15:09
php@7.1 on macOS 10.13.3 - Homebrew build logs
Homebrew build logs for php@7.1 on macOS 10.13.3
Build date: 2018-03-31 21:54:39