Skip to content

Instantly share code, notes, and snippets.

View nacho87's full-sized avatar

Jose Ignacio Decima nacho87

View GitHub Profile
@nacho87
nacho87 / gh-pages-deploy.md
Last active November 22, 2015 20:44 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@nacho87
nacho87 / inline-validation.js
Last active September 16, 2015 16:30 — forked from guyroutledge/inline-validation.js
Inline form validation with Gravity Forms
// if an invalid form field has been made valid,
// remove the shouty error highlighting - if a valid
// required field has been made invalid, start shouting
$('input, textarea, select').on('change', function(){
var $input = $(this);
var isRequired = $input.parents('.gfield').is('.gfield_contains_required');
var isValid = $input.is(':valid');
if ( isRequired && isValid ) {
@nacho87
nacho87 / font.scss
Last active September 10, 2015 04:10
Rem/PX calculator
@function calculateRem($size) {
$remSize: $size / 16px;
@return #{$remSize}rem;
}
@mixin fontSize($size) {
$unit: str-slice(#{$size}, -2);
$px: $size;
$rem: '';
// Convert Pixels
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas

Open the file hosts file.

$ vim /etc/hosts

Add a new entry with the wanted value.

127.0.0.1 customDomain.mx
/* ==========================================================================
Gravity Forms
========================================================================== */
ul.gform_fields {
padding: 0;
margin: 0;
}
.gform_fields, .content .gform_fields {
@nacho87
nacho87 / gist:41f11a6cffdb14e544fe
Last active August 29, 2015 14:07 — forked from ChangJoo-Park/gist:5443017
Rvm Install - Ruby - Rails - Node js
# If you meet install errors, see abid-hussain's comment
sudo apt-get --force-yes install build-essential openssl libreadline6 libreadline6-dev curl git-core \
zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev \
libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison
&&
\curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enabled