Skip to content

Instantly share code, notes, and snippets.

View Senhordim's full-sized avatar
🏠
Working from home

Diego Collares Senhordim

🏠
Working from home
View GitHub Profile
@Senhordim
Senhordim / index.html.slim
Last active August 29, 2015 13:55
Slim-template
doctype html
html
head
title Slim Examples
meta name="keywords" content="template language"
meta name="author" content=author
javascript:
alert('Slim supports embedded javascript!')
body
@Senhordim
Senhordim / simple_form_bootstrap.rb
Created February 19, 2014 18:53
Using Twitter Bootstrap 3 with simple_form
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
config.wrappers :bootstrap, :tag => 'div', :class => 'form-group', :error_class => 'has-error' do |b|
b.use :html5
b.use :placeholder
b.use :label
b.use :input, :wrap_with => { :tag => 'div', :class => 'controls' }
b.use :error, :wrap_with => { :tag => 'span', :class => 'help-block' }
b.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
end
@Senhordim
Senhordim / restart
Created March 17, 2014 17:16
VirtualBox restart
# OSX
sudo /Library/StartupItems/VirtualBox/VirtualBox restart
@Senhordim
Senhordim / pessoa.rb
Last active August 29, 2015 13:58
getter setter ruby
class Pessoa
def initialize
@nome = nome
@email = email
@senha = senha
end
def nome
@nome
@Senhordim
Senhordim / timeline.js
Created July 14, 2014 14:38
Order ou Sort ?
Template.timeline.helpers({
posts: function(){
return Post.find({});
}
});
@Senhordim
Senhordim / gist:4b2fdbff08b2de53100e
Created July 30, 2014 18:44
Scaffold mais limpo
config.generators do |g|
g.assets false
g.helper false
g.test_framework nil
end
@Senhordim
Senhordim / racks.css
Created September 27, 2014 21:53
Selecionar todas as classes que começa com title-
[class*="title-"]{
color:#444;
}
@Senhordim
Senhordim / variaveis
Last active August 29, 2015 14:10
Declarando váriaveis em JavaScript
// Declarando váriaveis em JavaScript
// String
var nome = "Diego"
// Number (independente se é float ou Interito em js é do tipo number)
var idade = 30
var valor = 150.90
// Boolean(Retorna true ou false)
.controller('OrdersCtrl', function($scope, $http) {
$http.get('https://api.blinktrade.com/api/v1/BRL/orderbook?crypto_currency=BTC').then(function(resp) {
console.log('Success', resp);
// For JSON responses, resp.data contains the result
}, function(err) {
console.error('ERR', err);
// err.status will contain the status code
})
})
*, *:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}