Skip to content

Instantly share code, notes, and snippets.

View thinkstylestudio's full-sized avatar

Theron Smith thinkstylestudio

View GitHub Profile
@thinkstylestudio
thinkstylestudio / cheaphints.lua
Created February 18, 2017 22:24
cheaphints: lightweight hints in hammerspoon
--[[
installation: put this file in ~/.hammerspoon and add this line to your init.lua:
local cheaphints = require "cheaphints"
usage: by default, just hit cmd+alt+E. you'll see a list of keys and associated
windows. if you hit escape, you'll exit hint mode. if you hit one of the keys in
the list, that window gets focused. the hint mode will exit automatically after
a while.
]]
@thinkstylestudio
thinkstylestudio / init.lua
Created February 18, 2017 22:23 — forked from moshen/init.lua
My hammerspoon configuration
-- Auto-reload config
function reloadConfig(files)
doReload = false
for _,file in pairs(files) do
if file:sub(-4) == ".lua" then
doReload = true
end
end
if doReload then
hs.reload()
@thinkstylestudio
thinkstylestudio / init.lua
Created February 18, 2017 22:23 — forked from moshen/init.lua
My hammerspoon configuration
-- Auto-reload config
function reloadConfig(files)
doReload = false
for _,file in pairs(files) do
if file:sub(-4) == ".lua" then
doReload = true
end
end
if doReload then
hs.reload()
@thinkstylestudio
thinkstylestudio / SomeDistantApiGateway.php
Created February 17, 2017 18:51 — forked from rizqidjamaluddin/SomeDistantApiGateway.php
Laravel API gateway classes with a service provider and config file
<?php
class SomeDistantApiGateway {
public function __construct($apiKey) {
$this->apiKey = $apiKey;
}
public function getSomeData() {
// whatever API request over guzzle or something
@thinkstylestudio
thinkstylestudio / SomeDistantApiGateway.php
Created February 17, 2017 18:51 — forked from rizqidjamaluddin/SomeDistantApiGateway.php
Laravel API gateway classes with a service provider and config file
<?php
class SomeDistantApiGateway {
public function __construct($apiKey) {
$this->apiKey = $apiKey;
}
public function getSomeData() {
// whatever API request over guzzle or something
@thinkstylestudio
thinkstylestudio / laravel-forge-deploy.sh
Created February 17, 2017 18:50 — forked from rap2hpoutre/laravel-forge-deploy.sh
Laravel Forge deploy script without downtime
# stop script on error signal
set -e
# remove old deployment folders
if [ -d "/home/forge/deploy" ]; then
rm -R /home/forge/deploy
fi
if [ -d "/home/forge/backup" ]; then
rm -R /home/forge/backup
fi
@thinkstylestudio
thinkstylestudio / .git-stats.sh
Created February 10, 2017 21:46 — forked from pstadler/.git-stats.sh
Print Git commit statistics for a specific author.
# Print Git commit statistics for a specific author
# Usage: git-stats "Linus Torvalds"
git-stats() {
author=${1-`git config --get user.name`}
echo "Commit stats for \033[1;37m$author\033[0m:"
git log --shortstat --author $author -i 2> /dev/null \
| grep -E 'files? changed' \
| awk 'BEGIN{commits=0;inserted=0;deleted=0} \
{commits+=1; if($5!~"^insertion") { deleted+=$4 } \
@thinkstylestudio
thinkstylestudio / UuidModel.php
Created January 27, 2017 19:52 — forked from danb-humaan/UuidModel.php
Trait for implementing UUIDs in Laravel models
<?php
namespace App\Traits;
use Rhumsaa\Uuid\Uuid;
use Illuminate\Database\Eloquent\ModelNotFoundException;
/**
* Trait UuidModel
* @package App\Traits
-Xms128m
-Xmx750m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=225m
-XX:+UseCompressedOops
-agentlib:yjpagent=probe_disable=*,disablealloc,disabletracing,onlylocal,disableexceptiontelemetry,delay=10000,sessionname=WebIde90
@thinkstylestudio
thinkstylestudio / BenSmith_Annotations.xml
Created December 17, 2016 07:22 — forked from RadTechDad/BenSmith_Annotations.xml
BenSmith - PHPStorm Live Templates
<templateSet group="BenSmith-Annotations">
<template name="anno" value="/**&#10;* $ANNOTATIONS$&#10;* @return Response&#10;*/" description="Add docblock ready for annotations below" toReformat="false" toShortenFQNames="true">
<variable name="ANNOTATIONS" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="true" />
<option name="HTML" value="true" />
<option name="PHP" value="true" />
</context>
</template>
<template name="@G" value="@Get(&quot;$ROUTE$&quot;, as=&quot;$NAME$&quot;)" description="Get route annotation" toReformat="false" toShortenFQNames="true">