Skip to content

Instantly share code, notes, and snippets.

View jesseleite's full-sized avatar

Jesse Leite jesseleite

View GitHub Profile
@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.

@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
{
/**
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 / 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();
});
@jesseleite
jesseleite / gist:2ddf6961ffcce2c50e13
Last active August 28, 2018 12:43
Editor Wars and Sublime Text

I see 3 main types of code editors...

On one end of the spectrum we have powerful neckbeard editors like Vim and Emacs. These editors are language agnostic, offer a ton of raw text editing power, and can be heavily extended. These are CLI editors with no real GUI. They have the steepest learning curve.

At the other end of the spectrum we have powerful IDEs like PHPStorm, Visual Studio, etc. These editors are developed from the ground up around a specific set of languages. They encourage mouse use, and offer a ton of debugging and refactoring tools, etc. The main downside is speed, mostly due to their project indexing and code intelligence features.

The third type of editor bridges the gap between the above types. I think the two most popular editors right now are Sublime Text and Atom. My favourite of the two is Sublime Text. Sublime is blazing fast, and offers both neckbeard-like editing power and IDE-like code intelligence features through community packages. Here's my list of must-haves:

**Pa

@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 / 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;
// cURL replacement for file_get_contents()
// Safer alternative to enabling allow_url_fopen in php.ini :)
function file_get_contents_curl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);