Skip to content

Instantly share code, notes, and snippets.

View juanpasolano's full-sized avatar
💻
Making

Juan Pablo Solano juanpasolano

💻
Making
View GitHub Profile
@juanpasolano
juanpasolano / img-to-svg.js
Created October 26, 2016 17:58
Img tag to inline svg
$(function(){
/*
* Replace all SVG images with inline SVG
* usage: <img src="my.svg" class="svg"/>
*/
jQuery('img.svg').each(function(){
var $img = jQuery(this);
var imgID = $img.attr('id');
@juanpasolano
juanpasolano / img-to-svg.js
Created October 26, 2016 17:58
Img tag to inline svg
$(function(){
/*
* Replace all SVG images with inline SVG
* usage: <img src="my.svg" class="svg"/>
*/
jQuery('img.svg').each(function(){
var $img = jQuery(this);
var imgID = $img.attr('id');
@juanpasolano
juanpasolano / readme.md
Last active November 10, 2018 02:39
Helpful Margins, padding and spacers

The spacers

Many times a component has different spacings around it depending on where it is located. Spacers help you add paddings and margins of different sizes conveniently, without having to create a new class for every case.

-You get access to classes like m-t-2 which stands to margin-top: 20px, so same goes for something like p-b-3 padding-bottom: 30px. -There is also m-v-2 which stands for vertical margin or margin-top: 20px; margin-bottom:20px; and p-h-3 would be padding horizontal 30px;

This classes use the convention type_position_negative_number_target

Member | Options | Example classes

@juanpasolano
juanpasolano / es.sh
Created November 5, 2015 05:50 — forked from Globegitter/es.sh
Easy install for elasticsearch on Ubuntu 14.04
cd ~
##If you want to install OpenJDK
#sudo apt-get update
#sudo apt-get install openjdk-8-jre-headless -y
###Or if you want to install Oracle JDK, which seems to have slightly better performance
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
@juanpasolano
juanpasolano / blacklist.conf
Last active April 9, 2016 14:55
Blacklist spam referal
map $http_referer $bad_referer {
hostnames;
default 0;
"~seo-platform.com" 1;
"~qualitymarketzone.com" 1;
"~video--production.com" 1;
"~hongfanji.com" 1;
"~iloveitaly.com" 1;
"~iloveitaly.co" 1;
"~fbdownloader.com" 1;
# update pacakges
sudo apt-get update
####################
# Add the Node.js maintained repositories to your Ubuntu package source list, this will ensure latest stable version
curl -sL https://deb.nodesource.com/setup | sudo bash -
# Install nodejs with apt-get (the -y flag will accept any question)
sudo apt-get install nodejs -y
vagrant box add hashicorp/precise32
vagrant init hashicorp/precise32
vagrant up
vagrant ssh
@juanpasolano
juanpasolano / Docker.sh
Last active August 29, 2015 14:26
Docker stuff
# Install docker
wget -qO- https://get.docker.com | sh
# Add user to the docker group (restart the server after)
sudo usermod -aG docker <user>
# Run docker container and login
# The -i flag tells docker container to connect to STDIN on the container
# The -t flag specifies to get a pseudo-terminal
@juanpasolano
juanpasolano / runVet.sh
Last active August 29, 2015 14:13
Run the vet enviroment
confirm () {
# call with a prompt string or use a default
read -r -p "${1:-Are you sure? [y/N]} " response
case $response in
[yY][eE][sS]|[yY])
true
;;
@juanpasolano
juanpasolano / api models Locations.js
Created September 9, 2014 21:50
seed database on sails js
/**
* Locations.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
seedData:[