Skip to content

Instantly share code, notes, and snippets.

View caiotarifa's full-sized avatar
💻
Coding...

Caio Tarifa caiotarifa

💻
Coding...
View GitHub Profile
@caiotarifa
caiotarifa / _reset.scss
Last active August 29, 2015 14:23
Bye, Normalize.
//***************//
// Reset //
//***************//
:root {
box-sizing: border-box;
cursor: default;
font: 16px/1.5 sans-serif;
text-rendering: optimizeLegibility;
text-size-adjust: 100%;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@caiotarifa
caiotarifa / application_helper.rb
Last active August 29, 2015 14:18
Helper to insert controller and view name as class in body.
module ApplicationHelper
def page_label
"#{controller_name} #{params[:action].gsub(/_/, " ")}"
end
end
@caiotarifa
caiotarifa / helper.rb
Last active August 29, 2015 14:18
External and Cacheable use of SVG (with Rails)
def svg_use file, options = {}
content_tag :svg, options do
content_tag :use, nil, :'xlink:href' => asset_path(file)
end
end
@caiotarifa
caiotarifa / __.js
Last active August 29, 2015 14:09
Simple DOM Selector for Vanilla JS
var __;
__ = function(selector, filter) {
'use strict';
var response;
function filtering(selectors, filter) {
switch (filter) {
case "first":
@caiotarifa
caiotarifa / application.js
Last active December 23, 2015 16:49
Modernizr.load to asynchronous load Facebook, Twitter and Google+.
Modernizr.load([
{
load: '//platform.twitter.com/widgets.js'
}, {
load: '//apis.google.com/js/plusone.js'
}, {
load: '//connect.facebook.net/en_US/all.js',
complete: function() {
return FB.init({
appId: '482807518397041',