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 / rspec_any_instance_test.rb
Created March 26, 2012 22:00 — forked from tfwright/rspec_any_instance_test.rb
Demonstrates unexpected behavior from .any_instance
require 'rspec/mocks'
describe Object do
it "should not care how many times a stubbed method is called" do
Object.should_receive(:some_method).any_number_of_times
end
end
@itspriddle
itspriddle / test.rb
Created January 6, 2012 20:10 — forked from jmazzi/test.rb
module Blah
def configuration
@configuration ||={}
end
def configure(&block)
yield configuration
end
@itspriddle
itspriddle / test.rb
Created January 6, 2012 20:06 — forked from jmazzi/test.rb
module Blah
def configuration
@configuration || {}
end
def configure(&block)
@configuration ||= {}
yield @configuration
@configuration.freeze
end
@itspriddle
itspriddle / will_paginate.rb
Created October 6, 2011 19:04
extends will_paginate to play well with Twitter's Bootstrap
# config/initializers/will_paginate.rb
module WillPaginate
module ActionView
def will_paginate(collection = nil, options = {})
options[:renderer] ||= BootstrapLinkRenderer
super.try :html_safe
end
class BootstrapLinkRenderer < LinkRenderer
@itspriddle
itspriddle / gist:1106724
Created July 26, 2011 13:13
Ruby Style Guide
Original Source: https://github.com/chneukirchen/styleguide
= Christian Neukirchen's Ruby Style Guide
You may not like all rules presented here, but they work very well for
me and have helped producing high quality code. Everyone is free to
code however they want, write and follow their own style guides, but
when you contribute to my code, please follow these rules:
console.log """
Ooh ooh
We're no strangers to love
You know the rules and so do I
A full commitment's what I'm thinking of
You wouldn't get this from any other guy
I just wanna tell you how I'm feeling
Gotta make you understand
{
:one => 1,
:two => 2,
:three => 3,
:four => 4,
:five => 5,
:six => 6,
:seven => 7,
:eight => 8,
:nine => 9,
#!/bin/bash
if [ $# -eq 0 ]; then
echo "$0 /path/to/log"
exit
fi
# Escaped color codes
BLACK=`echo -e '\033[0;30m'`
DK_GREY=`echo -e '\033[1;30m'`
@itspriddle
itspriddle / less.vim
Created April 17, 2010 01:49 — forked from bryanjswift/less.vim
LESS CSS for pathogen
au BufRead,BufNewFile *.less set ft=less syntax=less