Skip to content

Instantly share code, notes, and snippets.

View heavysixer's full-sized avatar
😎

Mark Daggett heavysixer

😎
View GitHub Profile
@heavysixer
heavysixer / eventable.rb
Created June 10, 2015 18:22
A Public::Activity concern which allows you to create custom activities when arbitrary triggers occur.
# PublicActivity Concern to allow custom activities to be created when certain triggers occur.
#
# Usage Example:
#
# class Challenge < ActiveRecord::Base
# include Eventable
# eventable :after_save => [{
# key: 'challenge.after_publish',
# when: "self.public_changed? && self.public?",
# recipients: 'self.potential_members'
@heavysixer
heavysixer / gist:47dd0e873af7dd76c647
Created May 21, 2015 01:09
Backbutton Directive.
(function() {
'use strict';
/**
* @ngdoc directive
* @name hsBackButton
* @module humansized.directives.backButton
* @restrict A
*
* @description
*
@heavysixer
heavysixer / gist:fdfcda1a2ff15a82861d
Created April 28, 2015 17:06
Two-way directive for stripping HTML from a input field. It will filter HTML as the user types it or as the variable linked to ngModel changes.
(function() {
'use strict';
/**
* @ngdoc directive
* @name stripHtml
* @module humansized.directives.stripHtml
* @restrict A
*
* @description
*
@heavysixer
heavysixer / gist:9749c7ddd2b8b0fc2c77
Created April 23, 2015 16:03
Keep Angular from breaking your Parallax animations
angular.module('app.directives')
.run(function($rootScope, $templateCache) {
$rootScope.$on('$routeChangeStart', function(event, next, current) {
if (typeof(current) !== 'undefined') {
/*
Once Angular adds something to its template cache it can render slightly different
the next time it is recalled. This can break functionality that expects the CSS of elements
to be exactly as it was coded (for example parallax). To prevent a specific file from being added
to your template cache you can remove it as needed this way:
*/
@heavysixer
heavysixer / gist:ff456103771c13f175b5
Last active August 29, 2015 14:01
Dismissible Panel Directive
/*
* This directive creates a dismissible message, which can either reappear each
* page refresh or appear only until it is dismissed by setting a cookie.
*
*##### Examples
*
* <div dismissible(data-title='NOTE' data-persist-dismiss >
* click the button to dismiss me!
* </div>
*
@heavysixer
heavysixer / gist:11322617
Last active August 29, 2015 14:00
proposed filter api for d4
// create a chart
var columnChart = d4.baseChart()
// mix in a feature to the chart
.mixin([{name: 'bars', feature: d4.features.stacked-shapes-series}])
// when using the feature apply a filter to the rects.
.using('bars',function(bar){
bar.svgFilter('feGaussianBlur', function(filter){
filter
@heavysixer
heavysixer / index.html
Created October 9, 2012 17:01 — forked from ZJONSSON/index.html
barStack - stacking with negative values
<!DOCTYPE html>
<html>
<head>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<title>barStack</title>
<style>
.axis text {
font: 10px sans-serif;
}
.axis path, .axis line {
@heavysixer
heavysixer / index.html
Created August 16, 2012 19:47 — forked from jeffthink/index.html
Simple d3 Radar Chart
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Simple Radar Chart</title>
<link rel="stylesheet" href="style.css"/>
<script src="http://mbostock.github.com/d3/d3.js?2.5.0"></script>
<script src="radar.js"></script>
</head><body><h1>Simple Radar Chart</h1>
<div id="viz">
</div>
class WizardController < ApplicationController
session :cookie_only => false, :only => :create
before_filter :determine_site_by_domain, :except=> [:upload_page_photo,:create_agent_logo,:index,:content,:customize,:pricing,:new_site, :next_step, :previous_step,:create_site, :brand_select]
before_filter :check_domain_in_admin
skip_before_filter :verify_authenticity_token, :only => [:upload_page_photo,:create_agent_logo]
#before_filter :verify_upload, :only => [:next_step_remote, :previous_step_remote]
#after_filter :set_button_positioning #req'd for IE7 with ajaxy goodness
layout 'wizard'
def new_site