Skip to content

Instantly share code, notes, and snippets.

View mnelson's full-sized avatar

Mike Nelson mnelson

View GitHub Profile
@mnelson
mnelson / App.js
Last active July 29, 2016 06:30
CSS Reset for a React App using Radium
import React from 'react'
import Reset from './styles/Reset'
let styles = React.renderToStaticMarkup(<Reset />);
document.head.insertAdjacentHTML('beforeEnd', styles);
// start the app
import Router from './components/Router'
@mnelson
mnelson / normalize.js
Last active October 14, 2015 17:23
normalize.css converted for radium.js
export default {
'html' : {
fontFamily: 'sans-serif',
msTextSizeAdjust: '100%',
webkitTextSizeAdjust: '100%'
},
'body' : {
margin: 0
},
'article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary': {
@mnelson
mnelson / database.yml
Created December 9, 2012 19:01
Example makara development database.yml
development: &DEV
adapter: makara
sticky_slaves: true
sticky_master: true
verbose: true
ansi_colors: true
db_adapter: mysql2
host: localhost
encoding: utf8
# fully resizable. just make sure you have it inside a relatively position element.
def modal(options = {}, &block)
options.merge!({:class => [options[:class], "modal clearfix"].join(' ')})
render :layout => '/shared/modal', :locals => {:options => options}, &block
end
@mnelson
mnelson / tddium.rake
Created November 24, 2012 19:19
Utilize S3 as a storage mechanism for Rails assets
namespace :tddium do
class AssetS3
BUCKET = "tddium_assets"
KEEP_AROUND = 7.days
def initialize(branch)
@branch = branch
end
@mnelson
mnelson / application.json.jbuilder
Created November 24, 2012 06:42
Use jbuilder to render jsonp responses.
raw_content = JSON.parse(yield)
json.content raw_content
json.jsonp! params[:callback] if jsonp?
$(".call-to-action").live("click",function(e){
try{
register_user_modal($(this).attr("href"));
} catch(err){alert(err);}
e.preventDefault();
return false;
});
function register_user_modal(target_link){
alert("wtf1");
var options = {
$(".call-to-action").live("click",function(e){
register_user_modal($(this).attr("href"));
e.preventDefault();
return false;
});
function register_user_modal(target_link){
var options = {
open:function(){
$.get(target_link,{},
function(r){
##### USAGE #####
#
# The StaticValue class gives you access to globally accessible constants through a human-readable and compact format.
#
# To define a new set of static values just define a class in this file such as:
# StaticValue.register('MyValues')
#
# Once your class is present you can add values to it via the add_item method:
# MyValues.add_item :Default, 0
# MyValues.add_item :Custom, 1
class Effect < AR::Base
scope :my_scope, select('project_id, taskType, user_id, SUM(hours)').joins(:project_task).where(:project_tasks => {:project_id => 2, :taskType => 'Pre-Sales'}).group('user_id')
end