A Pen by Carlos Rojas on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Twitter: @carlosrojas_o | |
Email: [email protected] | |
Youtube: https://youtube.com/carlosrojas84 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener("orientationchange", handleOrientation, true); | |
function handleOrientation(){ | |
if (Math.abs(window.orientation) == 90) { | |
angular.element(document.querySelector('#imagenBackground')).attr("src","img/background-landscape.png"); | |
angular.element(document.querySelector('#imagen-Background')).css("width","35%"); | |
} else { | |
angular.element(document.querySelector('#imagenBackground')).attr("src","img/background-portrait.png"); | |
angular.element(document.querySelector('#imagen-Background')).css("width","45%"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################# | |
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="." method="post"> | |
<noscript>You must <a href="http://www.enable-javascript.com" target="_blank">enable JavaScript</a> in your web browser in order to pay via Stripe.</noscript> | |
<input | |
type="submit" | |
value="Pay with Card" | |
data-key="PUBLISHABLE STRIPE KEY" | |
data-amount="500" | |
data-currency="cad" | |
data-name="Example Company Inc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toast(message) { | |
var $toast = $('<div class="ui-loader ui-overlay-shadow ui-body-e ui-corner-all"><h3>' + message + '</h3></div>'); | |
$toast.css({ | |
display: 'block', | |
background: '#fff', | |
opacity: 0.90, | |
position: 'fixed', | |
padding: '7px', | |
'text-align': 'center', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
// Let's do something with Google Maps: | |
var canvas = $( "#map_canvas" ); | |
var myLatlng = new google.maps.LatLng( -34.397, 150.644 ); | |
var myOptions = { | |
zoom: 8, | |
center: myLatlng, | |
mapTypeId: google.maps.MapTypeId.ROADMAP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Custom effects with .animate() | |
$( "div.funtimes" ).animate({ | |
left: "+=50", | |
opacity: 0.25 | |
}, | |
300, // Duration | |
function() { // Callback when the animation is finished | |
console.log( "done!" ); | |
} | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hide all level 1 headings over half a second; then wait for 1.5 seconds | |
// and reveal all level 1 headings over 0.3 seconds | |
$( "h1" ).hide( 500 ).delay( 1500 ).show( 300 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a button to stop all animations on the page: | |
$( "<button type='button'></button>" ) | |
.text( "Stop All Animations" ) | |
.on( "click", function() { | |
$( "body *" ).filter( ":animated" ).stop(); | |
}) | |
.appendTo( document.body ); |