Skip to content

Instantly share code, notes, and snippets.

View johhansantana's full-sized avatar

Johhan Santana johhansantana

View GitHub Profile
@johhansantana
johhansantana / Info.txt
Last active September 11, 2015 19:17 — forked from motorcitymobi/Info.txt
Smooth Scroll
Anchor:
<a name="programs"></a>
Link:
<a href="#programs" class="smoothScroll">
Add to Footer:
<script src="js/smoothscroll.js"></script>
$(function(){
$(".smoothScroll").click(function(e) {
e.preventDefault();
document.location.href = $(this).attr("href")
})
});
.pace-running .loader { opacity:0 }
.pace-done .loader {
opacity:1;
-webkit-transition:opacity 1s linear;
-moz-transition:opacity 1s linear;
-o-transition:opacity 1s linear;
transition:opacity 1s linear;
}
<script src="https://maps.googleapis.com/maps/api/js"></script>
<script>
function initialize() {
var myLatLng = {lat: 18.38162, lng: -66.133667};
var mapCanvas = document.getElementById('map');
var mapOptions = {
center: myLatLng,
zoom: 18,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
@johhansantana
johhansantana / install ruby on rails
Last active October 18, 2015 02:15
install ruby on rails
sudo apt-get update # This will pull a list of updates for your system.
sudo apt-get upgrade # This will download install the updates from the previous command.
sudo apt-get install curl # This will install the program cURL.
\curl -L https://get.rvm.io | bash -s stable # This will tell cURL to go to that web address and download a stable version of RVM.
source ~/.rvm/scripts/rvm # This sets the source for rvm to use.
rvm requirements # This will check that your system has all of RVM's requirements.
rvm install ruby # This will use rvm to install ruby
rvm use ruby --default # This will tell rvm to use ruby by default.
rvm rubygems current # This will download the latest version of rubygems.
gem install rails # This will download the latest version of rails.
@johhansantana
johhansantana / jquery-validate.js
Created October 31, 2015 17:09
jquery validate syntax
$('#contact_form').validate({
debug: true,
rules: {
name: "required", // should be: "user[username]"
email: { // should be: "user[email]"
required: true,
email: true
}
},
messages: {
@johhansantana
johhansantana / style.css
Created November 5, 2015 18:14
select first class with css
.myclass {
/* styles of the first one */
}
.myclass ~ .myclass {
/* styles of the others (must cancel the styles of the first rule) */
}
/* source: http://stackoverflow.com/questions/5287272/css-select-first-element-with-a-certain-class */
@johhansantana
johhansantana / script.js
Created November 9, 2015 19:57
bootstrap popover body overlay
$('[data-toggle="popover"]').on('mouseenter', function(){
$('.overlay-light').finish().fadeOut();
$('.overlay-light').fadeIn();
});
$('[data-toggle="popover"]').on('mouseleave', function(){
$('.overlay-light').finish().fadeIn();
$('.overlay-light').fadeOut();
});
@johhansantana
johhansantana / style.css
Last active November 9, 2015 19:59
add background overlay css
.live-background {
background-image: url('http://placehold.it/1500x1200');
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
min-height: 100vh;
min-width: 100vw;
}
.overlay{
@johhansantana
johhansantana / gist:02326abd5a31a7f15faa
Created November 17, 2015 23:29
list npm packages versions that are online
npm view generator-meanjs versions