Skip to content

Instantly share code, notes, and snippets.

View jesseleite's full-sized avatar

Jesse Leite jesseleite

View GitHub Profile
@sixlive
sixlive / 0.demo.gif
Last active March 23, 2024 14:39
An interactive way to search pull requests and check them out
0.demo.gif
@jasonvarga
jasonvarga / Hooks.php
Created March 1, 2021 17:03
PHPUnit Test Hooks Extension
<?php
namespace Tests;
use PHPUnit\Runner\AfterLastTestHook;
use PHPUnit\Runner\BeforeFirstTestHook;
use PHPUnit\Runner\BeforeTestHook;
class Hooks implements BeforeFirstTestHook, AfterLastTestHook, BeforeTestHook
{
@itsip
itsip / .vimrc
Created September 5, 2018 14:57
function for going to plugin
" Go to github plugin page
nnoremap <leader>pl :call GoToPlugin()<CR><CR>
function! GoToPlugin()
normal "lyi'
let plugin = @l
execute "!open https://www.github.com/" . plugin
endfunction
@juanmiret
juanmiret / init.lua
Last active July 23, 2018 18:18
Simple Vi mode with Karabiner-elements and Hammerspoon
local module = {}
module.debugging = false -- whether to print status updates
local eventtap = require "hs.eventtap"
local event = eventtap.event
local inspect = require "hs.inspect"
local keyHandler = function(e)
local watchFor = {
// Put this file in Program Files\Adobe\Photoshop\Presets\Scripts\
// In PhotoShop menu File > Automate > Scripts: layersToSprite.js
// Arrange layers into a sprite sheet.
if (documents.length > 0)
{
// --------------------------
docRef = activeDocument;
@JeffreyWay
JeffreyWay / PjaxMiddleware.php
Last active February 24, 2024 13:40
Laravel middleware for working with pjax.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Symfony\Component\DomCrawler\Crawler;
class PjaxMiddleware
@taylorotwell
taylorotwell / global-homestead.sh
Created September 23, 2015 21:40
Global Homestead Without Composer
alias homestead='function __homestead() { (cd ~/Documents/Code/Homestead && vagrant $*); unset -f __homestead; }; __homestead'
# Usage
homestead up
homestead halt
# etc...
<?php
// (string) $message - message to be passed to Slack
// (string) $room - room in which to write the message, too
// (string) $icon - You can set up custom emoji icons to use with each message
public static function slack($message, $room = "engineering", $icon = ":longbox:") {
$room = ($room) ? $room : "engineering";
$data = json_encode(array(
"channel" => "#{$room}",
"text" => $message,
@dwightwatson
dwightwatson / NullingTrait.php
Created June 18, 2015 05:57
NullingTrait.php
<?php namespace App\Support;
trait NullingTrait
{
/**
* Boot the trait. Adds an observer class for nulling.
*
* @return void
*/
public static function bootNullingTrait()
@tillsanders
tillsanders / intro.markdown
Last active June 24, 2021 20:17
Laravel: drag-and-drop repositioning with auto-save of DB entries

Laravel: drag-and-drop repositioning with auto-save of DB entries

Use case: Database entries are represented in a table. By grabbing and moving a row up or down the table, you can change the entries' order/position. The changes are submitted automatically via ajax.

  • Uses jQueryUI (custom download: sortable is needed)
  • newly created elements are added to the top (see route /jobs/create)