Skip to content

Instantly share code, notes, and snippets.

_.extend Backbone.Validation.callbacks,
valid: (view, attr, selector) ->
control = view.$('[' + selector + '=' + attr + ']')
group = control.parents(".control-group")
group.removeClass("error")
if control.data("error-style") == "tooltip"
# CAUTION: calling tooltip("hide") on an uninitialized tooltip
# causes bootstraps tooltips to crash somehow...
control.tooltip "hide" if control.data("tooltip")
@paulogaspar7
paulogaspar7 / dabblet.css
Created July 13, 2013 23:28 — forked from LeaVerou/dabblet.css
Flexible buttons with ems (duh!)
/**
* Flexible buttons with ems (duh!)
*/
body {
font-family: sans-serif
}
button {
padding: .5em .8em .4em;
@paulogaspar7
paulogaspar7 / dabblet.css
Created July 11, 2013 20:48 — forked from anonymous/dabblet.css
Attempt for Chrome-style progress-indicator with SVG and CSS animations
/**
* Attempt for Chrome-style progress-indicator with SVG and CSS animations
*/
@keyframes spin {
0% {
stroke: #00aeef
}
37.5% {
stroke: #ed1c24;
/**
* Attempt for Chrome-style progress-indicator with SVG and CSS animations
*/
@keyframes spin {
to {
stroke-dashoffset: -264;
}
}

An Elasticsearch in Ruby Crash Course!

By Andrew Cholakian

All examples use the Stretcher ruby gem

What is Elasticsearch?

  • An Information Retrieval (IR) System
  • A way to search your data in terms of natural language, and so much more
Mac OSX keyboard layout switching is a pain in the ass.
Using a keyboard layout different than the one actually printed on
your keys is also weird. The following keyboard shortcuts allow you
to create the various diacritics used in languages like Portuguese
on the British layout of a Mac keyboard.
Alt+e -> ´ Examples: é ó á
Alt+i -> ^ Examples: â ê
Alt+c -> ç
// Stick all your icons in a subfolder in your images folder. Put retina versions in a subfolder of that called "@2x".
$sprites: sprite-map("NAME_OF_SUBFOLDER/*.png");
$sprites2x: sprite-map("NAME_OF_SUBFOLDER/@2x/*.png");
// stolen from 37signals
@mixin retina-media() {
@media (min--moz-device-pixel-ratio: 1.3),
(-webkit-min-device-pixel-ratio: 1.3),
(min-device-pixel-ratio: 1.3),
(min-resolution: 1.3dppx) {
#!/usr/bin/osascript
-- Launche multiple SSH session
-- completely rewritten but inspired by github:xgdlm/iterm2-cssh
on run argv
set serverList to argv
-- Print help if no servers are given
@paulogaspar7
paulogaspar7 / createObject.js
Created October 29, 2012 00:51 — forked from mxriverlynn/createObject.js
An Object.create wrapper / shim for MarionetteJS
// Helpers
// -------
// For slicing `arguments` in functions
var slice = Array.prototype.slice;
// Borrow the Backbone `extend` method so we can use it as needed
Marionette.extend = Backbone.Model.extend;
// A wrapper / shim for `Object.create`. Uses native `Object.create`