Skip to content

Instantly share code, notes, and snippets.

View thedelchop's full-sized avatar

Joseph DelCioppio thedelchop

View GitHub Profile
@thedelchop
thedelchop / dracula.vim
Created May 10, 2019 14:20
Dracula SpaceVim Theme
"=============================================================================
" dracula.vim --- dracula theme for SpaceVim
" Author: Joseph DelCioppio < joseph.delcioppio@gmail.com >
" URL: https://spacevim.org
" License: GPLv3
"=============================================================================
" The default color palette that Dracula.vim exports
" {
" 'bgdarker': ['#191A21', 234],
" 'bgdark': ['#21222C', 235],
@thedelchop
thedelchop / companies.txt
Created October 21, 2016 23:20
List of companies affected by today's DDOS attack
ActBlue
Basecamp
Big cartel
Box
Business Insider
CNN
Cleveland.com
Etsy
Github
Grubhub
@thedelchop
thedelchop / RegistrationsController
Last active January 15, 2016 16:09
A controller that can not be extended without being modified
class RegistrationsController < ApplicationController
def create
# Some logic to sign up
render json: @user, each_serializer: UserSerializer
end
end
def notify_user
Notification.create text: text do |notification|
notificaiton.user = followed_user
notification.notable = user
end
end
@thedelchop
thedelchop / acceptance_spec_helper.rb
Created May 8, 2013 16:41
These are my two spec_helper files for the suite
require "capybara/rspec"
require 'rspec/example_steps'
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
require File.expand_path(File.dirname(__FILE__) + "/support/helpers")
require File.expand_path(File.dirname(__FILE__) + "/support/paths")
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
include ApplicationHelper
include HelperMethods
include FacebookAuthHelper
@thedelchop
thedelchop / .rspec
Created December 3, 2012 15:40
Here is the TmuxNotifier and the .rspec changes needed to use it.
--color -f TmuxNotifier
@thedelchop
thedelchop / polite_remittance_slip.rb
Created September 28, 2012 15:49
Old code that was hard to read and NOT polite
module DEFT
class RemittanceSlip
def initialize(*credits)
@credits = credits
end
def print
output = print_header_record
@thedelchop
thedelchop / css-counter.scss
Created May 8, 2012 01:27
Using counters inside CSS
form {
counter-reset: form-number;
.control-group {
&:before{
@include border-radius(20px);
content: counter(form-number);
counter-increment: form-number;
@thedelchop
thedelchop / payable_decorator.rb
Created April 20, 2012 18:39
Basically and integration test
PayableDecorator < ApplicationDecorator
decorates :payable
def due_date_in_words
if payable.due_date > Date.today
"#{due_date} (#{h.distance_of_time_in_words(payable.due_date, Date.today)} from now)"
elsif payable.due_date < Date.today
"#{due_date} (#{h.distance_of_time_in_words(payable.due_date, Date.today)} ago)"
else
"#{due_date} (today)"
@thedelchop
thedelchop / omniauth_callbacks_controller.rb
Created February 28, 2012 18:18
Callback for Harvest
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
def harvest
# You need to implement the method below in your model
current_user.update_attributes(:harvest_token = request.env["omniauth.auth"][WHERE EVER THE TOKEN IS IN THE HASH HARVEST RETURNS]
redirect_to WHERE YOU WANT TO GO
end
end