This file contains 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
Meteor.methods({ | |
test: function() { | |
throw new Meteor.Error("name of the error", "Here is the reason"); | |
} | |
}); | |
Meteor.call('test', function(error, response){ | |
if (error) { | |
console.log("error", error); | |
} else { |
This file contains 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
/** | |
* Add an index to each loop | |
*/ | |
UI.registerHelper('indexedArray', function(context, options) { | |
if (context) { | |
return context.map(function(item, index) { | |
item._index = index + 1; | |
return item; | |
}); | |
} |
This file contains 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
$.ajax({ | |
url: '../assets/php/get_customer_id.php', | |
data: { email: "email@email.com" }, | |
type: 'post', | |
success: function(data) { | |
var xmlDoc = $.parseXML(data), | |
$xml = $(xmlDoc); | |
console.log($xml.find("customer_id").text()); | |
}, | |
error: function(jqXHR, textStatus, errorThrown) { |
This file contains 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
.diamond-inside-square (@square: 100px; @background-img) { | |
.square(@square); | |
.rotate(-45deg); | |
margin: @square/4; | |
overflow: hidden; | |
&:after { | |
.square(@square*1.5); | |
.rotate(45deg); | |
background: url(@background-img); | |
display: block; |
This file contains 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
.hero-mask(@trianlgle-height: 40px) { | |
height: (@trianlgle-height / 2); | |
position: absolute; | |
bottom: 0; | |
left: 0; | |
width: 100%; | |
z-index: 1000; | |
&:before, | |
&:after { |
This file contains 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
©{current_time format="%Y"} |
This file contains 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
{exp:switchee variable="{variable_to_test_against}" parse="inward"} | |
{case value="''"} | |
<!-- value is empty --> | |
{/case} | |
{case default="Yes"} | |
<!-- default --> | |
{/case} | |
{/exp:switchee} |
This file contains 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 isValidZipCode( zipCode ) { | |
var pattern = new RegExp(/^\d{5}(?:[-\s]\d{4})?$/); | |
return pattern.test(zipCode); | |
} | |
if( !isValidEmailAddress( zipCode ) ) { | |
/* do stuff here */ | |
} |
This file contains 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 isValidEmailAddress(emailAddress) { | |
var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i); | |
return pattern.test(emailAddress); |
This file contains 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
/* position static in mobile media queries by default */ | |
#js-media-test { position: static; } | |
/* and position it relative in larger sizes | |
you can set the break to whatever makes the most sense */ | |
@media (max-width: 769px) { | |
#js-media-test { position: relative; } | |
} |