Skip to content

Instantly share code, notes, and snippets.

View mikespokefire's full-sized avatar

Michael Smith mikespokefire

View GitHub Profile
<script type="text/javascript">
/* <![CDATA[ */
JAVASCRIPT CODE HERE
/* ]]> */
</script>
@mikespokefire
mikespokefire / dd_belated_png.jquery.js
Created February 4, 2011 16:27
Want to find every PNG on the current page and Alpha transparency fix them with DD_belatedPNG? Then this gist is for you.
$(document).ready(function() {
$('img[src$=".png"]').each(function() {
DD_belatedPNG.fixPng(this);
});
});
@mikespokefire
mikespokefire / jquery_toggle.js
Created May 7, 2011 13:02
Example of jQuery toggle
$(document).ready(function() {
$('#toggler').toggle(
function() {
$('div').animate({ height: '200px' }, 2000, 'swing');
},
function() {
$('div').animate({ height: 'auto' }, 2000, 'swing');
}
);
DEPRECATION WARNING: ActionDispatch::ShowExceptions.rescue_responses is deprecated. Please configure your exceptions using a railtie or in your application config instead. (called from <top (required)> at /Users/mike/code/<redacted>/config/environment.rb:5)
@mikespokefire
mikespokefire / controller
Created January 26, 2012 13:02 — forked from anonymous/controller
search
class LoginController < ApplicationController
def overview
@student = Student.search params[:search]
end
class Card
include ActiveModel::Validations
validates :name, :presence => true
end
source_paths << File.join(File.dirname(File.expand_path(__FILE__)), "rails-template")
remove_file "README.rdoc"
remove_file "public/index.html"
##
# Setup rbenv
create_file ".rbenv-version", "1.9.3-p0"
##
def pending_orders?
orders.where(:status => Order::PENDING).exists?
end
namespace :flickr do
desc "Pull all data from Flickr"
task :pull => :environment do
# Remove everything to do with the gallery
#Album.destroy_all
#Photo.destroy_all
var myFunc = function() {
console.log(this); //currently outs DOMelement
};
if ($('body.home').length) {
$('.slideshow').cycle({
after: myFunc
});
}