Skip to content

Instantly share code, notes, and snippets.

View mnelson's full-sized avatar

Mike Nelson mnelson

View GitHub Profile
@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 / 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 / _super.js
Last active August 31, 2015 15:56
Pie Guide
var A = pie.base.extend({
init: function(){
console.log('A');
this._super();
}
});
var B = A.extend({
init: function() {
this._super();
{
// JSHint Default Configuration File (as on JSHint website)
// See http://jshint.com/docs/ for more details
"maxerr" : 50, // {int} Maximum error before stopping
// Enforcing
"bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase" : false, // true: Identifiers must be in camelCase
"curly" : false, // true: Require {} for every new block or scope
@mnelson
mnelson / tenanct_mixins.scss
Created May 15, 2014 19:18
Tenant mixin for sass variables.
/*
$listvar:
"appname1" "blue",
"appname2" "red"
;
.my-selector {
@include tenant($listvar) {
background-color: $var;
@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 = {