Skip to content

Instantly share code, notes, and snippets.

View MattWilliamsDev's full-sized avatar

Matt Williams MattWilliamsDev

View GitHub Profile
@MattWilliamsDev
MattWilliamsDev / javascript.json
Created October 13, 2020 19:06
JS/JSX, & TS Snippets for VSCode
{
"console log": {
"prefix": "log",
"body": [
"console.log( '$1', $2 );"
],
"description": "Log output to console"
},
"react functional component": {
"prefix": "react",
@MattWilliamsDev
MattWilliamsDev / typescript.json
Last active December 19, 2018 21:32
Typescript User Snippets
{
"Jasmine it() descriptor": {
"prefix": "it"
, "body": [
"it( 'should ${1:do something testable}', () => {"
, " ${2:// Do something}"
, "});$0"
],
"description": "Describes a Jasmine test for a feature using it()"
},
// This one should show a message
window.MC.lib.appDeeplink( {
appName: 'Campaigns' // Application Name
, target: 'fullscreen'
, link: '/Campaigns?id=NDQ1OjQ2OjA%3D'
, options: {
interactionName: 'My Interaction Name'
, returnAppName: 'Journey Builder'
}
} );
var init = function() {
/* $( "input[name=a1]" ).change(function() {
$("#b1").val(0);
$("#c1").val(0);
sumItUp();
});
$( "input[name=b1]" ).change(function() {
$("#a1").val(0);
$("#c1").val(0);
$( document ).ready(function() {
getFormJson(run_after);
});
var $ar4ec = $("#ar4ec").validate({
// Rules for form validation
rules : {
exemption : {
required : true
},
$( '.smart-form input, .smart-form input[disabled], .smart-form textarea, .smart-form select' ).each( function() {
var name = $( this ).attr( 'name' );
if ( jsonData && jsonData[ name ] ) {
$( this ).val( jsonData[ name ] );
}
} );