Skip to content

Instantly share code, notes, and snippets.

Darren Terhune darrenterhune

Block or report user

Report or block darrenterhune

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kouheiszk
kouheiszk / _form.html.erb
Created Sep 11, 2015
simple_form.rb for semantic ui
View _form.html.erb
<%= f.input :email,
wrapper: :semantic_icon_input,
label: false,
required: true,
placeholder: t('users.form.placeholder.email'),
left_icon: 'user' %>
@tedgrubb
tedgrubb / ttransparency.rb
Last active May 4, 2017
Paperclip Processor that finds the background color and replaces it with a transparent background. Also simulates anti-aliasing using '-fuzz' to get rid of pixelated artifacts.
View ttransparency.rb
# lib/paperclip_processors/transparency.rb
module Paperclip
class Transparency < Thumbnail
# Find the background and replace with transparency.
# -fuzz 20% simulates antialiasing
CONVERT_OPTIONS = [
'-alpha', 'set',
'-fill', 'white',
'-draw', "'color 0,0 replace'",
@kirillzubovsky
kirillzubovsky / How to delete all tweets with Ruby fast
Last active Apr 20, 2018
A quick way to delete all your tweets using Twitter archive and a ruby script.
View How to delete all tweets with Ruby fast
require 'twitter'
require "json"
USERNAME = 'YOUR_TWITTER_USER_NAME'
ARCHIVE_PATH = 'archive/data/js/tweets'
client = Twitter::REST::Client.new do |config|
config.consumer_key = 'TWITTER_APP_API_KEY'
config.consumer_secret = 'TWITTER_APP_API_SECRET'
config.access_token = 'TWITTER_APP_ACCESS_TOKEN'
@basti
basti / application.rb
Last active Jun 11, 2018 — forked from keighl/application.rb
Local Rails 4 assets precompilation using Capistrano 3 and rsync
View application.rb
# Speed things up by not loading Rails env
config.assets.initialize_on_precompile = false
@toobulkeh
toobulkeh / deploy.rb
Created Jan 2, 2014 — forked from benedikt/rails.rb
Updated for Capistrano 3.
View deploy.rb
# encoding: UTF-8
# Place in config/deploy.rb
namespace :rails do
desc "Open the rails console on each of the remote servers"
task :console do
on roles(:app) do |host| #does it for each host, bad.
rails_env = fetch(:stage)
execute_interactively "ruby #{current_path}/script/rails console #{rails_env}"
@xaviershay
xaviershay / build_frontend.sh
Last active Dec 24, 2015
SASS + Coffee + Concatenation in prod
View build_frontend.sh
#!/bin/bash
set -exo pipefail
BUILD_ENV=$1
if [ `uname` == 'Darwin' ]; then
OSX=1
JSCOMPRESSOR="yuicompressor --type js"
else
OSX=
@MicahChalmer
MicahChalmer / .htaccess
Last active May 1, 2016
Scripts to set up Ruby 1.9.3 on a DreamHost shared hosting account via rbenv and ruby-build, and run a Rack app with it via FastCGI.
View .htaccess
<IfModule mod_fastcgi.c>
AddHandler fastcgi-script .fcgi
</IfModule>
<IfModule mod_fcgid.c>
AddHandler fcgid-script .fcgi
</IfModule>
Options +FollowSymLinks +ExecCGI
RewriteEngine On
@rlmattax
rlmattax / gist:3962926
Created Oct 27, 2012
Active Admin User Impersonation
View gist:3962926
ActiveAdmin.register User do
menu :parent => "Users"
member_action :impersonate, :method => :get do
user = User.find(params[:id])
flash[:notice] = "Successfully logged in as : #{user.email} #{view_context.link_to('Be careful!', root_path)}".html_safe
begin
warden.set_user(resource,{:scope=>:user,:run_callbacks=>false})
rescue
flash[:error] = "Unable to log you in. Poop."
View actionpack.lib.action_controller.status_codes.rb
Status Code Status Message Symbol
1xx Informational
100 Continue :continue
101 Switching Protocols :switching_protocols
102 Processing :processing
2xx Success
200 OK :ok
201 Created :created
202 Accepted :accepted
You can’t perform that action at this time.