Skip to content

Instantly share code, notes, and snippets.

View justinperkins's full-sized avatar
🥶

Justin Perkins justinperkins

🥶
View GitHub Profile
@justinperkins
justinperkins / jquery-auth-token.js
Created October 26, 2012 17:48
Put auth-token on all jQuery Ajax Requests
$(function(){
var tokenValue = $("meta[name='csrf-token']").attr('content');
$.ajaxSetup({
headers: {'X-CSRF-Token': tokenValue}
});
})
@justinperkins
justinperkins / lost-disc-found.txt
Last active February 22, 2022 17:58
Disc Return Info
Looks like you found one of my discs with a QR code on it! Thanks for taking the time to scan it and read this page.
I love getting my discs back when I've lost or forgotten them. I always offer a reward in the form of a disc or two from my disc storage in exchange for getting my disc back.
Since this page is public, I'm not including my phone number.
Email me here: discreturn@tacofan.com
Include your phone # if you want and I'll text you since that's probably easier
@justinperkins
justinperkins / pre-push
Last active September 14, 2022 15:19
Git pre push hook for branch naming convention validation
#!/usr/bin/env ruby
local_branch = `git rev-parse --abbrev-ref HEAD`.chomp
valid_branch_regex = /^(task|chore|feature|fix|text|hotfix|release)\/[a-z0-9._-]{2,30}$/
if local_branch =~ valid_branch_regex
exit 0
else
puts "Branch name does not match our convention, please make sure it follows this pattern: #{valid_branch_regex}"