Skip to content

Instantly share code, notes, and snippets.

View alanhogan's full-sized avatar

Alan Hogan alanhogan

View GitHub Profile
# This file only contains additions to Zepto to add lesser-used functions
# from jQuery that we do actually need.
if this.Zepto
do ($ = Zepto) ->
# innerHeight & outerHeight are needed by <a plugin we use>
#
# outerHeight is documented at http://api.jquery.com/outerHeight/
#
@alanhogan
alanhogan / vimeo-in-2008-and-2010.html
Created July 14, 2013 06:40
The ascii art logo that inspired mine (at alanhogan.com)
<!--
___ ___ ___ __ __ ___ _____ ______
/ \ /_ \ /_ \ /_ \/_ \/_ \ / ___ \ / __ \
|/\ \ / / | | | / \ / \ | / /___\ \ / / \ \
\ \/ / | | | | | | | | | ______/ | | | |
\ / | | | | | | | | | \ __ | | | |
\ / | |_ | | | | | | \ \__/ / \ \__/ /
\/ \__/ \_\ \_\ \_\ \____/ \______/
You know, for videos.
require 'sass/plugin'
#allows inline sass!
::Sass::Plugin.options[:load_paths] = Rails.application.config.assets[:paths].to_a + Compass.configuration.sass_load_paths
class Descss
def initialize(module_name)
# Modules output content, so they should include the .css extension.
# (This is why we don't look for module.sass, just module.css.sass.)
begin
file = File.open("app/assets/stylesheets/nri-modules/#{module_name}.css.sass")
rescue
file = File.open("app/assets/stylesheets/nri-modules/#{module_name}.css.scss")
end
@source = file.read
if Rails.env.development?
class DevtoolsController < ApplicationController
def modules
@modules = Dir["app/assets/stylesheets/nri-modules/*.css.*"].map do |filename|
filename =~ %r{/([^/]+)\.css}
$1
end
render layout: 'text'
end
- title "Modules"
%h1 CSS Modules
%ul
- @modules.each do |mod|
%li
- name = "<code><b>#{mod}</b></code>"
- desc = Descss.new mod
- name += ": <b>#{desc.name}</b>" if desc.has_name?
- title "#{@module_name} Module"
- desc = Descss.new @module_name
.l-max-readable-width.l-h-center.l-v-spaced
.txt
%header
%h1
Module info:

payWithTweet is a jQuery plugin that makes you go tweet something to unlock an action on the page. You can bypass it by running:

function createCookie(name,value,days){var expires;if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+ date.toGMTString();}else{expires="";}
document.cookie=encodeURIComponent(name)+"="+ encodeURIComponent(value)+ expires+"; path=/";}

createCookie("tweetToDownload",true,30);

Keybase proof

I hereby claim:

  • I am alanhogan on github.
  • I am alanhogan (https://keybase.io/alanhogan) on keybase.
  • I have a public key ASBsuC4ft6MgMV-UB77lHthuXxHIhQhvcYqMt_RY1Sl70go

To claim this, I am signing this object:

@alanhogan
alanhogan / compass-retina-sprites.scss
Created June 5, 2012 23:21 — forked from thulstrup/compass-retina-sprites.scss
Using Compass to generate normal and retina sprite maps
$sprites: sprite-map("sprites/*.png");
$sprites-retina: sprite-map("sprites-retina/*.png");
@mixin sprite-background($name) {
background-image: sprite-url($sprites);
background-position: sprite-position($sprites, $name);
background-repeat: no-repeat;
display: block;
height: image-height(sprite-file($sprites, $name));
width: image-width(sprite-file($sprites, $name));