Skip to content

Instantly share code, notes, and snippets.

View jxpx777's full-sized avatar
🤠

Jamie Phelps jxpx777

🤠
View GitHub Profile
require 'delayed_job'
require 'net/http'
class ImagesController < ApplicationController
def fetch
components = params[:url].split('/')
url = clean_url(components[0])
filename = components[1] + params[:format]
@jxpx777
jxpx777 / gist:3722583
Created September 14, 2012 15:20
Delayed Job failure message
{Job failed to load: undefined class/module WebImageJob. Handler: "--- !ruby/struct:WebImageJob\nurl: !ruby/object:URI::HTTP\n scheme: http\n user: \n password: \n host: www.amazon.com\n port: 80\n path: /\n query: \n opaque: \n registry: \n fragment: \n parser: \noriginal_url: \ntarget_url: \n"
/Users/j/.rvm/gems/ruby-1.9.3-p194@onepassword-imageserver/gems/delayed_job-3.0.3/lib/delayed/backend/base.rb:86:in `rescue in payload_object'
/Users/j/.rvm/gems/ruby-1.9.3-p194@onepassword-imageserver/gems/delayed_job-3.0.3/lib/delayed/backend/base.rb:84:in `payload_object'
/Users/j/.rvm/gems/ruby-1.9.3-p194@onepassword-imageserver/gems/delayed_job-3.0.3/lib/delayed/backend/base.rb:94:in `block in invoke_job'
/Users/j/.rvm/gems/ruby-1.9.3-p194@onepassword-imageserver/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:60:in `call'
/Users/j/.rvm/gems/ruby-1.9.3-p194@onepassword-imageserver/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:60:in `block in initialize'
/Users/j/.rvm/gems/ruby-1.9.3-p194@onepassword-
@jxpx777
jxpx777 / gist:2836639
Created May 30, 2012 14:24
Git list of filenames with changes since last push
git log --name-only --format="%h" origin/master..HEAD | sort -u | grep -v -E -e '^[a-f0-9]+$'
@jxpx777
jxpx777 / Readme.md
Created May 17, 2012 19:00
JSE: Chrome HTTP auth callback

Original source:

@jxpx777
jxpx777 / gist:1942309
Created February 29, 2012 16:37 — forked from dkobia/gist:1233483
GitHub Emoji
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@jxpx777
jxpx777 / widget.woo-kb-cats.php
Created January 31, 2012 15:15
Edited knowledgebase categories widget to allow the user to specify categories to exclude
<?php
/*---------------------------------------------------------------------------------*/
/* Knowledgebase category list */
/*---------------------------------------------------------------------------------*/
class Woo_Supportpress_kb_cats extends WP_Widget {
function Woo_Supportpress_kb_cats() {
$widget_ops = array('description' => 'Lists knowledgebase categories.' );
parent::WP_Widget(false, __('SupportPress - Knowledgebase Categories', 'woothemes'), $widget_ops);
}
@jxpx777
jxpx777 / articles_controller.rb
Created December 27, 2011 19:44
Why is this returning multiple copies of each article?
class ArticlesController < ApplicationController
def index
@articles = Article.joins(:product_platform_references => {:product_platform => [:product, :platform]}, :article_categories => :category)
end
end
@jxpx777
jxpx777 / new_markdown_file
Created December 4, 2011 16:54
Create a new, empty .md file in the Elements folder and open it in TextMate.
echo "" > ~/Dropbox/Elements/`date +%Y%m%d_%H%M%S`.md && open -b com.macromates.textmate `ls -t ~/Dropbox/Elements | head -n1`
@jxpx777
jxpx777 / railscast.bbcolor
Created July 26, 2011 01:03 — forked from gbbowers/railscast.bbcolor
Railscast bbcolor file I did a few years ago. Feel free to improve it and update for missing items, etc.
"Color:Background" = "rgb(11051,11051,11051)";
"Color:Background:Grep Replace Pattern" = "rgb(62915,62915,62915)";
"Color:Background:Grep Search Pattern" = "rgb(62915,62915,62915)";
"Color:CTagsIdentifier" = "rgb(48776,20456,15006)";
"Color:ColorAttributesSeparately" = 1;
"Color:Comment" = "rgb(26214,26214,26214)";
"Color:Comment:Markdown" = "rgb(43036,43036,43036)";
"Color:Foreground" = "rgb(59110,57825,56540)";
"Color:Foreground:Grep Replace Pattern" = "rgb(0,0,0)";
"Color:Foreground:Grep Search Pattern" = "rgb(0,0,0)";
@jxpx777
jxpx777 / gist:1065623
Created July 5, 2011 19:15 — forked from gruber/gist:1063605
Simple Inbox Archiving Script for Apple Mail
-- See article here: http://daringfireball.net/2007/07/simple_inbox_sweeper
-- The following should be one long line:
set _description to "All unflagged, read messages in each IMAP account
inbox will be moved to the “Archive” mailbox corresponding to that
account. This action is not undoable."
tell application "Mail"
display alert "Archive read messages from IMAP inboxes?" buttons ¬
{"Cancel", "Archive"} cancel button 1 message _description