Skip to content

Instantly share code, notes, and snippets.

View thinkstylestudio's full-sized avatar

Theron Smith thinkstylestudio

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / saeven.lua
Created February 18, 2017 23:14 — forked from Saeven/saeven.lua
Hammerspoon script to launch and tile apps
local workApplications = { 'Mail','HipChat','PhpStorm','Safari','Charles'}
local workApplicationWatcher;
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "H", function()
hs.notify.new({title="Hammerspoon", informativeText="Setting home layout"}):send()
local homeMonitor = "LG ULTRAWIDE"
local windowLayout = {
{"PhpStorm", nil, homeMonitor, {x=0, y=0, w=0.6, h=1}, nil, nil},
{"Charles", nil, homeMonitor, {x=0.6, y=0.6, w=0.4, h=0.4}, nil, nil},
@thinkstylestudio
thinkstylestudio / init.lua
Created February 18, 2017 23:15 — forked from amine2233/ init.lua
My Hammerspoon
-- Hotkey mash
local mash = {"cmd", "alt", "ctrl"}
local mash_move = {"cmd", "ctrl"}
local mash_app = {"shift","ctrl","alt"}
hs.alert("Reloaded Config")
-- instant window resizing
hs.window.animationDuration = 0
@thinkstylestudio
thinkstylestudio / init.lua
Created February 18, 2017 23:17 — forked from hswolff/init.lua
hammerspoon init.lua
-- watch for changes
hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", hs.reload):start()
--
-- start custom config
--