Skip to content

Instantly share code, notes, and snippets.

int count = 1;
count = "1"; // Type mismatch: cannot convert from String to int
public double total(double price, int count) {
return price * count;
}
this.total(3.99, "10");
// The method total(double, int) in the type PriceController
@blefebvre
blefebvre / types.ts
Last active June 11, 2020 10:41
Types in JS
// Examples of types in JS
let count = 1;
console.log(typeof count); // number
count = "1";
console.log(typeof count); // string
count = {count: 1};
console.log(typeof count); // object
@blefebvre
blefebvre / .content.xml
Created September 29, 2016 18:48
Mobile reference component example
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
cq:icon="alias"
jcr:description="Reference content from another paragraph"
jcr:primaryType="cq:Component"
jcr:title="Mobile Reference"
sling:resourceSuperType="foundation/components/reference"
componentGroup="General"/>
@blefebvre
blefebvre / multifield.js
Created March 7, 2016 19:11
Added support for full screen properties dialogs to multifield.js
/**
* Original code written by Sreekanth Choudry Nalabotu
* blog post: http://experience-aem.blogspot.com/2015/06/aem-61-touch-ui-composite-multifield-store-values-as-child-nodes.html
*/
(function () {
var DATA_EAEM_NESTED = "data-eaem-nested";
var CFFW = ".coral-Form-fieldwrapper";
function setSelect($field, value){
var select = $field.closest(".coral-Select").data("select");
@blefebvre
blefebvre / createApp.php
Created July 30, 2014 17:34
creating a cordova app via php
<?
echo exec('
cordova create hello com.example.hello HelloWorld
') . "<br />";
?>