Skip to content

Instantly share code, notes, and snippets.

View jathayde's full-sized avatar
🚜

John Athayde jathayde

🚜
View GitHub Profile
background-image: -moz-linear-gradient(-45deg,
rgba(255, 255, 255, 0.15) 77%,
transparent 77%,
transparent 79%,
rgba(255, 255, 255, 0.15) 79%,
rgba(255, 255, 255, 0.15) 81%,
transparent 81%,
transparent 83%,
rgba(255, 255, 255, 0.15) 83%,
rgba(255, 255, 255, 0.15) 85%,
<script type="text/javascript" charset="utf-8">
function getCreditCardType(accountNumber)
{
//start without knowing the credit card type
var result = "unknown";
//first check for MasterCard
if (/^5[1-5]/.test(accountNumber))
{
<script type="text/javascript" charset="utf-8">
function handleEvent(event)
{
var value = event.target.value,
type = getCreditCardType(value);
switch (type)
{
case "mastercard":
//show MasterCard icon
@jathayde
jathayde / app-controllers-images_controller.rb
Created January 4, 2012 18:55
Trying to figure out polymorphic association with image to other items
def new
@image = Image.new
respond_with @image
end
<script>
$(function() {
$('input#feature_headline').change(function () {
alert('foo');
var str = "";
str = $(this).text();
str = str.toLowerCase().replace(/ /g, '-');
$('input[name="feature[slug]"]').val(str);
})
})
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie ie6 lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie ie7" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie ie8" lang="en"> <![endif]-->
<!-- Consider adding a manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
class Category < ActiveRecord::Base
has_many :categories, :class_name => "Category"
belongs_to :category, :class_name => "Category",
:foreign_key => "parent_id"
has_many :line_items
end
selector {
position: absolute;
top: 100px;
left: 50px;
width: 400px;
}
Found libtidy in: /usr/lib/libtidy.A.dylib
Exiting
/Users/jathayde/.rvm/gems/ruby-1.9.2-p290@artflow/gems/tidy-1.1.2/lib/tidy/tidybuf.rb:5:in `<class:Tidybuf>': uninitialized constant DL::Importable (NameError)
from /Users/jathayde/.rvm/gems/ruby-1.9.2-p290@artflow/gems/tidy-1.1.2/lib/tidy/tidybuf.rb:3:in `<top (required)>'
from /Users/jathayde/.rvm/gems/ruby-1.9.2-p290@artflow/gems/tidy-1.1.2/lib/tidy.rb:25:in `<module:Tidy>'
from /Users/jathayde/.rvm/gems/ruby-1.9.2-p290@artflow/gems/tidy-1.1.2/lib/tidy.rb:21:in `<top (required)>'
from /Users/jathayde/.rvm/gems/ruby-1.9.2-p290@artflow/gems/html5-rack-tidy-0.2.4/lib/rack/tidy/cleaner.rb:1:in `<top (required)>'
from /Users/jathayde/.rvm/gems/ruby-1.9.2-p290@artflow/gems/html5-rack-tidy-0.2.4/lib/rack/tidy.rb:64:in `new'
from /Users/jathayde/.rvm/gems/ruby-1.9.2-p290@artflow/gems/actionpack-3.1.0/lib/action_dispatch/middleware/stack.rb:43:in `build'
from /Users/jathayde/.rvm/gems/ruby-1.9.2-p290@artflow/gems/actionpack-3.1.0/lib/action_dispatch/middlewa
@jathayde
jathayde / gist:1262511
Created October 4, 2011 19:16
whois apple.com
jathayde$ whois apple.com
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
APPLE.COM.WWW.BEYONDWHOIS.COM
APPLE.COM.WAS.PWNED.BY.M1CROSOFT.COM