Skip to content

Instantly share code, notes, and snippets.

View dannyvassallo's full-sized avatar

Dan Vassallo dannyvassallo

View GitHub Profile
@dannyvassallo
dannyvassallo / _form.html.erb
Last active February 18, 2016 04:35
How to get Materialize CSS radio buttons in platformatec simple form for Rails 4.
<!-- In your simple_form use this code but change the column name, collection values, and model reference -->
...
<%= f.input :campaign_type, :label => false, :collection => [['Both Media Types', 'Both Media Types'], ['Just Video', 'Just Video'], ['Just Photo', 'Just Photo']], :label_method => :last, :value_method => :first, :as => :materialize_radio_buttons, :checked => @campaign.campaign_type %>
...
<a class="twitter-timeline" href="https://twitter.com/ForwardNJ" data-widget-id="664848106555617281">Tweets by @ForwardNJ</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
@dannyvassallo
dannyvassallo / index.html
Created November 2, 2015 19:39
Dreamweaver Bootstrap Boilerplate
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Jess's Bootstrap Dreamweaver Boiler</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
</head>
<body>
<!--*************************** -->
@dannyvassallo
dannyvassallo / webkitappearancenone.md
Created October 14, 2015 14:56
Disable iOS automatic input styling
.aclassname{
...
-webkit-appearance: none;
...
}
@dannyvassallo
dannyvassallo / repsonsive-vevo.md
Last active October 7, 2015 19:12
Responsive VEVO Embed without a framework

The CSS:

<style>
.embed-container { 
	position: relative;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
	max-width: 100%;
}
@dannyvassallo
dannyvassallo / _materializecss-rails-confirm.coffee
Last active November 24, 2016 00:29
Replace Rails 4 confirmation/prompts with a toast message from Dogfalo Materialize CSS. Regular repo - https://github.com/Dogfalo/materialize Sass Gem - https://github.com/mkhairi/materialize-sass Website - http://materializecss.com/
$ ->
$.rails.allowAction = (link) ->
return true unless link.attr("data-confirm")
$.rails.showConfirmDialog link
false
$.rails.confirmed = (link) ->
link.removeAttr "data-confirm"
link.trigger "click.rails"
@dannyvassallo
dannyvassallo / theboxmodel.md
Last active September 16, 2015 02:17
Box Model Explanation

####Explanation of the different parts:

  • Content - The content of the box, where text and images appear
  • Padding - Clears an area around the content. The padding is transparent
  • Border - A border that goes around the padding and content
  • Margin - Clears an area outside the border. The margin is transparent
div {
 width: 300px;
@dannyvassallo
dannyvassallo / csstypes.md
Last active September 16, 2015 02:03
Different ways you can use CSS

#How to Use Inline, In-Document, and Linked CSS

###3 Main Ways to use CSS

####Inline Styles Inline styles are the most basic way of applying styles to an element, in that you apply the styles directly to the tag in your HTML. For example, this is an inline style:

@dannyvassallo
dannyvassallo / csspositioning.md
Last active September 16, 2015 00:54
All CSS positioning with examples

#The position Property The position property specifies the type of positioning method used for an element.

There are four different position values:

  • static
  • relative
  • fixed
  • absolute
@dannyvassallo
dannyvassallo / allcsspositioningproperties.md
Last active September 15, 2015 23:50
All CSS Positioning Properties
Property Description Values
bottom Sets the bottom margin edge for a positioned box auto length % inherit
clip Clips an absolutely positioned element shape auto inherit
cursor Specifies the type of cursor to be displayed url auto crosshair default pointer move e-resize ne-resize nw-resize n-resize se-resize sw-resizes-resize w-resize text wait help
left Sets the left margin edge for a positioned box