Skip to content

Instantly share code, notes, and snippets.

View marioizquierdo's full-sized avatar

Mario Izquierdo marioizquierdo

View GitHub Profile
// Style this how you want it to look
.input-placeholder-text
color: #777
=input-placeholder
&.placeholder
@extend .input-placeholder-text
&:-moz-placeholder
@extend .input-placeholder-text
&::-webkit-input-placeholder
@marioizquierdo
marioizquierdo / add_bnet_profiles_console_method.rb
Created October 25, 2011 21:20
Add a Bnet Profile to your dev users
# Copy paste this method in the rails console
# If you have a user in your dev environment, you can add a bnet profile like this:
#
# add_bnet_profile_to :login => 'LiquidTyler', :bnet_id => 416097, :bnet_name => "LiquidTyler"
# add_bnet_profile_to :mlg_id => 1234, :bnet_id => 416097, :bnet_name => "LiquidTyler"
# add_bnet_profile_to :user => liquid, :bnet_id => 416097, :bnet_name => "LiquidTyler"
#
# So, you need to specify the bnet_id and the bnet_name of this user, and any of
# user model, login, mlg_id or id to identify the user.
@marioizquierdo
marioizquierdo / gist:1473087
Created December 13, 2011 17:43
Programming Tip: Naming matters!

You are reading someone else JavaScript code and you find this:

var checkshit = function(a, x) {
  var ret, _i, _len;
  if (x == null) x = 'checked';
  var ret = true;
  for (_i = 0, _len = a.length; _i < _len; _i++) {
    if ((x === 'checked' && !a[_i].checked) || (x === 'unchecked' && a[_i].checked)) {
      ret = false;

}

@marioizquierdo
marioizquierdo / gist:3711034
Created September 13, 2012 00:40
Press Ctrl+E to reload page CSS
$(function() {
// Reload All Stylesheets
var reloadCSS = function() {
var $stylesheets;
$stylesheets = $('link[rel=stylesheet]');
$stylesheets.each(function(i, el) {
var $stylesheet, href, newHref, noCacheToken;
$stylesheet = $(el);
href = $stylesheet.attr('href');
@marioizquierdo
marioizquierdo / git-commit-msg-jira-trello.rb
Last active July 3, 2018 11:24
git hook commit message for JIRA and Trello branches
#!/usr/bin/env ruby
#
# Git commit-msg hook.
#
# If your branch name is in the form "story/DIO-1234/description",
# automatically adds "DIO-1234/description: " to commit messages, unless they mention "DIO-1234" already.
#
# If your branch name is in the form "mario/1234-my-trello-card",
# automatically adds "1234-my-trello-card: " to commit messages, unless they mention "1234" already.
#
@marioizquierdo
marioizquierdo / vaderscript_introduction.md
Last active June 7, 2016 03:27
VaderScript syntax introduction

VaderScript

Is a dynamic scripting language that compiles into JavaScript and is fully compatible with it. JSON is also a subset of VaderScript.

VaderScript builds on top of the dynamism of JavaScript, enhancing its functional nature. Just like JavaScript at it's core, the primitives of the language are simple and powerful, but VaderScript keeps the consistency on every level, avoiding surprises and unexpected behavior whenever possible.

The big difference is that VaderScript is more strict. Undefined access and invalid types will throw errors, unless explicitly allowed. This way, rebel properties are shut down before they have the chance to cause any trouble.