Skip to content

Instantly share code, notes, and snippets.

View walterdavis's full-sized avatar

Walter Lee Davis walterdavis

View GitHub Profile
<style type="text/css">
/* twitter feed styling */
.jcarousel-container, .jcarousel-clip { height:300px /* amount of tweets displayed x 100 */; }
.tweetbox { border:1px solid #ddd; color:#696969; }
.tweetbox li { border-bottom:1px solid #ddd; }
.tweetbox a { color:#4484A1; }
.tweetbox a:hover { color:#4484A1; }
.twitter-link { background-color:#4484A1; }
.twitter-link a { color:#fff; }
var submenus = $$('.submenu').invoke(
'setStyle',
'height: auto; max-height: 0; min-height: 0; overflow: hidden'
);
document.on('click', '#parentBoxId a', function(evt, elm){
evt.stop();
var target = $(elm.href.split('#').last());
if(target){
submenus.invoke('setStyle', 'max-height: 0');
target.morph('max-height: 900px');
< script language = "JavaScript" >
<!--// merci an cem!
var Wochentag = new Array("Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag");
var uebungen = new Array("Stehende Positionen", "Handbalance", "Rückwärtsbeugen", "Sitzende Positionen & Drehungen", "Vorwärtsbeugen");
var souebung = "Sonntag - Pause!"
<!-- var miuebung="+ Pranayama!" -->
var miuebung = " "
<action-encoding>UTF-8</action-encoding>
<library-action name="functions">
<action-javascript>
/**
* Write a script to an external file.
* name: common name of script (domloaded, windowload, custom)
* fileParameter: the action-file that holds this file
* content: string or array of strings containing the content
* returns URL to generated file, for linking purposes
*/
@walterdavis
walterdavis / tidy_site.rb
Last active December 25, 2015 07:18
Post-process a Web site to "tidy" all the pages' HTML.
=begin
Initial Setup (run once at the command prompt, as an admin user).
First, check your environment with
gem env
If you get an error at this point, it is likely you don't have
rubygems installed, and you should do that. The easiest way to
get it all ready to go at once is to install RVM. Instructions
<iframe width="480" height="180" src="//www.mixcloud.com/widget/iframe/?feed=http%3A%2F%2Fwww.mixcloud.com%2FTechnoLiveSets%2Fguygerber-live-wisdom-of-the-glove-closing-party-show-sirocco-ibiza-02-10-2013%2F&mini=&stylecolor=&hide_artwork=&embed_type=widget_standard&embed_uuid=13dcc8f4-fd5d-4505-b963-995520c07518&hide_tracklist=1&hide_cover=" frameborder="0"></iframe><div style="clear:both; height:3px; width:472px;"></div><p style="display:block; font-size:12px; font-family:Helvetica, Arial, sans-serif; margin:0; padding: 3px 4px; color:#02a0c7; width:472px;"><a href="http://www.mixcloud.com/TechnoLiveSets/guygerber-live-wisdom-of-the-glove-closing-party-show-sirocco-ibiza-02-10-2013/?utm_source=widget&amp;utm_medium=web&amp;utm_campaign=base_links&amp;utm_term=resource_link" target="_blank" style="color:#02a0c7; font-weight:bold;">@GuyGerber - Live @ Wisdom Of The Glove Closing Party Show (Sirocco Ibiza) - 02-10-2013</a><span> by </span><a href="http://www.mixcloud.com/TechnoLiveSets/?utm_source=widget&amp;u
//www.mixcloud.com/widget/iframe/?feed=http%3A%2F%2Fwww.mixcloud.com%2Fslaggbrothers%2Fthe-slagg-brothers-6-towns-show-120913%2F&mini=&stylecolor=&hide_artwork=&embed_type=widget_standard&embed_uuid=d72d39e4-4568-4948-8dd5-14bcf8d7b943&hide_tracklist=&hide_cover=%22%20frameborder=%220%22%3E%3C/iframe%3E%3Cdiv%20style=%22clear:both%3B%20height:3px%3B%20width:372px%3B%22%3E%3C/div%3E%3Cp%20style=%22display:block%3B%20font-size:12px%3B%20font-family:Helvetica,%20Arial,%20sans-serif%3B%20margin:0%3B%20padding:%203px%204px%3B%20color:#02a0c7%3B%20width:372px%3B%22%3E%3Ca%20href=%22http://www.mixcloud.com/slaggbrothers/the-slagg-brothers-6-towns-show-120913/?utm_source=widget&amp%3Butm_medium=web&amp%3Butm_campaign=base_links&amp%3Butm_term=resource_link%22%20target=%22_blank%22%20style=%22color:#02a0c7%3B%20font-weight:bold%3B%22%3EThe%20Slagg%20Brothers%206%20Towns%20Show%2012.09.13%3C/a%3E%3Cspan%3E%20by%20%3C/span%3E%3Ca%20href=%22http://www.mixcloud.com/slaggbrothers/?utm_sour
ce=widge
t&amp%3Butm_medium=web&a
//www.mixcloud.com/widget/iframe/?feed=http%3A%2F%2Fwww.mixcloud.com%2Fslaggbrothers%2Fthe-slagg-brothers-6-towns-show-120913%2F&mini=1&stylecolor=&hide_artwork=&embed_type=widget_standard&embed_uuid=d8c715bf-6556-422e-941b-9ebdfdc6934a&hide_tracklist=&hide_cover=" frameborder="0"></iframe><div style="clear:both; height:3px; width:372px;"></div><p style="display:block; font-size:12px; font-family:Helvetica, Arial, sans-serif; margin:0; padding: 3px 4px; color:#02a0c7; width:372px;"><a href="http://www.mixcloud.com/slaggbrothers/the-slagg-brothers-6-towns-show-120913/?utm_source=widget&amp;utm_medium=web&amp;utm_campaign=base_links&amp;utm_term=resource_link" target="_blank" style="color:#02a0c7; font-weight:bold;">The Slagg Brothers 6 Towns Show 12.09.13</a><span> by </span><a href="http://www.mixcloud.com/slaggbrothers/?utm_source=widget&amp;utm_medium=web&amp;utm_campaign=base_links&amp;utm_term=profile_link" target="_blank" style="color:#02a0c7; font-weight:bold;">Slagg Br
others 6
Towns Radio</a><span> o
@walterdavis
walterdavis / user.rb
Created October 2, 2013 13:52
This is the largest concentration of Stripe-specific code anywhere in the application.
class User < ActiveRecord::Base
rolify
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :name, :email, :password, :password_confirmation, :remember_me, :stripe_token, :coupon
var hiders = $$('.hider').invoke('setStyle', 'z-index: 500');
var overlay = new Element('div');
overlay.setStyle({
position: 'fixed', backgroundColor: 'rgba(0,0,0,0.7)',
zIndex: '499', top:'0', left: '0', width: '100%',
height: '100%', display: 'none'
});
$(document.body).insert(overlay);
setInterval(function(){
var visible = hiders.any(function(el){