Skip to content

Instantly share code, notes, and snippets.

View vebersol's full-sized avatar

Vinícius Ebersol vebersol

  • Pelotas/RS/Brasil
View GitHub Profile
@vebersol
vebersol / Key Binding
Last active August 29, 2015 13:55
Sublime options
[
{ "keys": ["alt+shift+w"], "command": "insert_snippet", "args": { "name": "Packages/XML/long-tag.sublime-snippet" } },
{ "keys": ["ctrl+k", "ctrl+z"], "command": "title_case" },
{ "keys": ["ctrl+shift+r"], "command": "reindent" }
]
@vebersol
vebersol / gist:7603130
Created November 22, 2013 16:52
Performance
<html>
<head>
<title>Positioning Scripts</title>
<!-- exemplo de posicionamento ineficiente -->
<script src="arquivo1.js"></script>
<script src="arquivo2.js"></script>
<script src="arquivo3.js"></script>
<script src="arquivo4.js"></script>
<script src="arquivo5.js"></script>
<script src="arquivo6.js"></script>
@vebersol
vebersol / index.html
Created November 13, 2013 12:27
Another vertically centered text menu
<!--[if lt IE 8]>
<style>
ul li { width: 114px; display: block; float: left; }
ul li a { position: absolute; top:50%; left: 10px; width: }
ul li a span {position: relative; top: -50%; left: 10px;}
</style>
<![endif]-->
<ul>
<li><a href="javascript:;"><span>Link has two lines, really two lines</span></a></li>
@vebersol
vebersol / Array.prototype.some.js
Created August 26, 2013 13:05
Searching with Array.prototype.some
function findEmployee(id) {
var employee;
employees.some(function (e) {
if (e.id === id) {
employee = e;
return true;
}
});
return employee;
}
@vebersol
vebersol / config.rb
Created July 24, 2013 14:20
Remove hash from compass sprite filenames. It works with retina-sprites plugin. Add these lines to your config.rb file.
module Compass::SassExtensions::Functions::Sprites
def sprite_url(map)
verify_map(map, "sprite-url")
map.generate
generated_image_url(Sass::Script::String.new(map.name_and_hash))
end
end
module Compass::SassExtensions::Sprites::SpriteMethods
def name_and_hash
# no layout
<%= yield(:page_javascript) %>
# na view
<% content_for(:page_javascript) do %>
# o que for escrito aqui vai no layout
<% end %>
@vebersol
vebersol / googlemapsfix.css
Created October 23, 2012 02:15
bootstrap.css interfering google maps window
img[src*="gstatic.com/"], img[src*="googleapis.com/"] {
max-width: 99999px;
}