Skip to content

Instantly share code, notes, and snippets.

Todd Holdman cernalpanic

Block or report user

Report or block cernalpanic

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
@cernalpanic
cernalpanic / gist:11359027
Created Apr 28, 2014
why aren't these methods available in rails console?
View gist:11359027
I'm trying to work with the rails console and this gem:
https://github.com/sethvargo/isbndb
in my my Gem file:
gem 'isbndb', '~> 2.0.2'
(ran 'bundle install' and 'bundle update')
opened the console (rails c)
@cernalpanic
cernalpanic / gist:5414211
Created Apr 18, 2013
in_groups_of example. bootstrap row class every third
View gist:5414211
<div class="span6">
<h3><%= link_to "Background Images", bgimages_path %></h3>
<% @bgimages.in_groups_of(3, false) do |bgimage_rows| %>
<div class="row">
<% for bgimage in bgimage_rows %>
<div class="span2 text-left">
<a href="<%= bgimage.bgimagefile.url %>"><img class="bgimagethumb img-polaroid" src="<%= bgimage.bgimagefile.url(:thumb) %>" /></a>
</div>
<% end %>
</div>
@cernalpanic
cernalpanic / gist:5247569
Created Mar 26, 2013
This is in my Show Session Dump debug. How do I access that "message"? I'm trying to use it for a :notice in my controller.
View gist:5247569
flash: #<ActionDispatch::Flash::FlashHash:0x007fe4d2c275e0 @used=#<Set: {}>, @closed=false, @flashes={:notice=>#<HTTParty::Response:0x7fe4d208b768 parsed_response={"result"=>2, "message"=>"!!!!!!!!!!!!!!THIS IS WHAT I WANT TO GET!!!!!!!!!!"}, @response=#<Net::HTTPOK 200 OK readbody=true>, @headers={"date"=>["Tue, 26 Mar 2013 17:51:00 GMT"], "server"=>["Apache/2.2.3 (CentOS)"], "x-powered-by"=>["PHP/5.3.3"], "cache-control"=>["no-cache"], "access-control-allow-origin"=>["http://205.186.187.224"], "content-length"=>["73"], "connection"=>["close"], "content-type"=>["application/json"]}>}, @now=nil>
return_to: "http://0.0.0.0:3000/posts"
session_id: "63401b3f5acce1dd49acda048a9c58fe"
user_return_to: "/posts/36"
View debbug
function debug_this($args) {
print_r($args);
}
add_filter( 'attachment_fields_to_save', 'RE_attachment_field_version_save', 10, 2 );
function RE_attachment_field_version_save( $post, $attachment ) {
debug_this(get_post_ancestors($post['ID']));
if( isset( $attachment['re-current-version'] ) ) {
View output
it asks for my password at the very end of the script. i have no idea what this script is. i have been moving this user account from one mac to another for a few generations.
bash-3.2$ /usr/bin/env perl -v
/usr/bin/env: line 1: s: command not found
Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
Enable subpixel font rendering on non-Apple LCDs
Enable the 2D Dock
View gist:2764164
HOMEBREW_VERSION: 0.9
HEAD: c72d755ad60ff04b443bf3e8b8c44b27d7bc6ca3
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: dual-core 64-bit penryn
OS X: 10.7.4
Kernel Architecture: x86_64
Xcode: 4.3.2
GCC-4.0: N/A
GCC-4.2: build 5666
View gist:2764155
==> Downloading http://ftpmirror.gnu.org/wget/wget-1.13.4.tar.bz2
Already downloaded: /Users/toddholdman/Library/Caches/Homebrew/wget-1.13.4.tar.bz2
/usr/bin/tar xf /Users/toddholdman/Library/Caches/Homebrew/wget-1.13.4.tar.bz2
==> ./configure --disable-debug --prefix=/usr/local/Cellar/wget/1.13.4 --sysconfdir=/usr/local/etc --with-ssl=openssl --disable-iri
./configure --disable-debug --prefix=/usr/local/Cellar/wget/1.13.4 --sysconfdir=/usr/local/etc --with-ssl=openssl --disable-iri
configure: configuring for GNU Wget 1.13.4
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
View gist:2763484
==> Downloading http://ftpmirror.gnu.org/wget/wget-1.13.4.tar.bz2
Already downloaded: /Users/toddholdman/Library/Caches/Homebrew/wget-1.13.4.tar.bz2
/usr/bin/tar xf /Users/toddholdman/Library/Caches/Homebrew/wget-1.13.4.tar.bz2
==> ./configure --disable-debug --prefix=/usr/local/Cellar/wget/1.13.4 --sysconfdir=/usr/local/etc --with-ssl=openssl --disable-iri
./configure --disable-debug --prefix=/usr/local/Cellar/wget/1.13.4 --sysconfdir=/usr/local/etc --with-ssl=openssl --disable-iri
configure: configuring for GNU Wget 1.13.4
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
View gist:2763419
## ---------------------- ##
## Running config.status. ##
## ---------------------- ##
This file was extended by wget config.status 1.13.4, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES =
CONFIG_HEADERS =
View gist:2763184
-e 's|@''UNDEFINE_STRTOK_R''@|0|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r c++defs.h' \
-e '/definition of _GL_ARG_NONNULL/r arg-nonnull.h' \
-e '/definition of _GL_WARN_ON_USE/r warn-on-use.h'; \
< ./string.in.h; \
} > string.h-t && \
mv string.h-t string.h
rm -f strings.h-t strings.h && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
You can’t perform that action at this time.