Skip to content

Instantly share code, notes, and snippets.

View itspriddle's full-sized avatar
🤘
clickity clack

Joshua Priddle itspriddle

🤘
clickity clack
View GitHub Profile
@itspriddle
itspriddle / README.md
Created January 4, 2023 16:17 — forked from eusonlito/README.md
Laravel Auth and Session without database. Using a remote API as Auth and Data provider.

This is an example of a web that uses a remote API as a database wrapper.

The remote API is stateless and the web uses cookies to maintain session persistence.

The API authentication endpoint returns a TOKEN that allows the web to make each request to the API with the user authentication header.


Este es un ejemplo de web que usa una API remota como wrapper de base de datos.

@itspriddle
itspriddle / keybase.md
Created August 28, 2019 04:57
Keybase proof for itspriddle (Regenerated 2019-08-28 1:00:00 -4:00)

Keybase proof

I hereby claim:

  • I am itspriddle on github.
  • I am itspriddle (https://keybase.io/itspriddle) on keybase.
  • I have a public key whose fingerprint is A777 4AFA 7584 8144 6211 272F 9855 8247 A164 48FA

To claim this, I am signing this object:

@itspriddle
itspriddle / Generate Password.rb
Created February 27, 2018 17:26
LaunchBar Action to generate a password (based on https://github.com/johnbintz/keepass-password-generator)
#!/usr/bin/env ruby
# Generates a random password using keepass-password-generator
# Imported from https://github.com/johnbintz/keepass-password-generator
require 'securerandom'
require 'set'
#!/usr/bin/env osascript
-- Copy a UUID to the clipboard
set the clipboard to do shell script "uuidgen | tr -d '\n'"
# Run tests with `PROFILE_FG=1 [rake|rspec]` to profile FactoryGirl
#
# Example output:
#
# **Class** | **create** | **build** | **attributes_for**
# --------- | ---------- | --------- | ------------------
# **Total** | **11** | **0** | **0**
# Post | 5 | 0 | 0
# Author | 3 | 0 | 0
# User | 3 | 0 | 0
@itspriddle
itspriddle / irbrc.rb
Created January 14, 2014 15:12
Fixes an issue with AwesomePrint and ActiveRecord 3 abstract models (https://github.com/michaeldv/awesome_print/pull/147). Drop it in `~/.irbrc`
# Work around for https://github.com/michaeldv/awesome_print/pull/147
AwesomePrint::ActiveRecord.send :include, Module.new {
def awesome_active_record_class_with_fix(object)
return awesome_class(object) if object.respond_to?(:abstract_class?) && object.abstract_class?
super(object)
end
def self.included(base)
base.class_eval do
alias_method :awesome_active_record_class_without_fix, :awesome_active_record_class
class Bitmask
ACTIONS = %W(create read update destroy)
def self.dump(actions)
(actions & ACTIONS).sum { |a| 1 << ACTIONS.index(a) }
end
def self.load(mask)
ACTIONS.reject { |a| ((mask || 0) & 1 << ACTIONS.index(a)).zero? }
end
@itspriddle
itspriddle / test.markdown
Created June 14, 2013 21:21
Blah Blah Blah

Hi

This is a test

class Josh
  def name; :name; end
end
@itspriddle
itspriddle / setup-git-bundler-merge-driver
Last active August 13, 2018 08:41
This script makes git automatically run `bundle install` when a merge conflict with Gemfile.lock occurs. Run it once per project to setup `.gitattributes` and `.gitconfig`
#!/usr/bin/env bash
# Usage: setup-git-bundler-merge-driver
# Help: Configures git to use a custom merge driver to resolve Gemfile.lock
# merge conflicts.
if [ ! -f Gemfile ]; then
echo 'No `Gemfile` found! Aborting'
exit 1
fi