This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (awesome) { puts "Awesome." } else { puts "Refactor that shit." } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Paperclip convert id => id_partition | |
# | |
require 'ftools' #FileUtils | |
class PaperclipExtend | |
def self.obtain_class | |
class_name = ENV['CLASS'] || ENV['class'] | |
uploads_path = ENV['UPLOADS_PATH'] || ENV['uploads_path'] | |
raise "Must specify CLASS" unless class_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Create a function to preform the timestamp update. | |
CREATE OR REPLACE FUNCTION update_updated_at_column() | |
RETURNS TRIGGER AS $$ | |
BEGIN | |
NEW.updated_at = now(); | |
RETURN NEW; | |
END; | |
$$ language 'plpgsql'; | |
-- Create a trigger to run this function prior to an UPDATE on a row. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Last login: Fri Jul 6 09:25:53 on ttys004 | |
jlee:~ jlee$ /usr/local/sbin/gdisk /dev/disk1 | |
GPT fdisk (gdisk) version 0.8.2 | |
Caution: invalid main GPT header, but valid backup; regenerating main header | |
from backup! | |
Caution! After loading partitions, the CRC doesn't check out! | |
Warning! Main partition table CRC mismatch! Loaded backup partition table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#check to see if arguments are set | |
E_BADARGS=65 | |
if [ ! -n "$1" ] | |
then | |
echo "Usage: `basename $0` textfilename [rtffilename optional]" | |
exit $E_BADARGS | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# return the current git branch name | |
parse_git_branch() { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ →\ \1/' | |
} | |
# return the string of state of the branch | |
parse_git_dirty() { | |
D="$(git status 2> /dev/null | tail -n1 | awk '{ print $1 }' )" | |
if [ "$D" = "nothing" ] ; then | |
echo -e "(clean) " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$('img[data-mouseover]').hover(function() { | |
$(this).data('_mouseover', $(this).attr('src')); | |
$(this).attr('src', $(this).data('mouseover')); | |
},function() { | |
$(this).attr('src', $(this).data('_mouseover')); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= link_to image_tag("logo.png", :'data-mouseover' => "/assets/logo-hover.png"), root_path %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
if mouseover = options.delete(:mouseover) | |
ActiveSupport::Deprecation.warn ":mouseover option is deprecated and will be removed from Rails 4.0" | |
options[:onmouseover] = "this.src='#{path_to_image(mouseover)}'" | |
options[:onmouseout] = "this.src='#{src}'" | |
end | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
params.require(:animal).permit( | |
:name, :description, :trainer_id, :photo_id, :video_id, :tag_list, | |
trainers_attributes: [:id, :first_name, :last_name, :_destroy] | |
) |
OlderNewer