terminal:
npm i --save-dev rollup rollup-watch rollup-plugin-typescript typescript typings
npm i -S react react-dom
./node_modules/.bin/typings install react react-dom --save
mkdir src dist
touch src/index.tsxterminal:
npm i --save-dev rollup rollup-watch rollup-plugin-typescript typescript typings
npm i -S react react-dom
./node_modules/.bin/typings install react react-dom --save
mkdir src dist
touch src/index.tsx| /*! | |
| * Copyright 2015 Google Inc. All rights reserved. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| /** | |
| * This code is licensed under the terms of the MIT license | |
| * | |
| * Deep diff between two object, using lodash | |
| * @param {Object} object Object compared | |
| * @param {Object} base Object to compare with | |
| * @return {Object} Return a new object who represent the diff | |
| */ | |
| function difference(object, base) { | |
| function changes(object, base) { |
| <?php | |
| namespace GM\VirtualPages; | |
| /** | |
| * @author Giuseppe Mazzapica <[email protected]> | |
| * @license http://opensource.org/licenses/MIT MIT | |
| */ | |
| class Controller implements ControllerInterface { | |
| private $pages; |
| 'use strict'; | |
| // simple express server | |
| var express = require('express'); | |
| var app = express(); | |
| var router = express.Router(); | |
| app.use(express.static('public')); | |
| app.get('/', function(req, res) { | |
| res.sendfile('./public/index.html'); |
| <ul class="events"> | |
| <?php | |
| $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1; | |
| $atts = array( | |
| 'paged' => $paged, | |
| 'title' => NULL, | |
| 'limit' => 100, | |
| 'css_class' => NULL, | |
| 'show_expired' => FALSE, | |
| 'month' => NULL, |
| <?php | |
| $file = '/path/to/file.png'; | |
| $filename = basename($file); | |
| $upload_file = wp_upload_bits($filename, null, file_get_contents($file)); | |
| if (!$upload_file['error']) { | |
| $wp_filetype = wp_check_filetype($filename, null ); | |
| $attachment = array( | |
| 'post_mime_type' => $wp_filetype['type'], | |
| 'post_parent' => $parent_post_id, |
| // _decimal.scss | MIT License | gist.github.com/terkel/4373420 | |
| // Round a number to specified digits. | |
| // | |
| // @param {Number} $number A number to round | |
| // @param {Number} [$digits:0] Digits to output | |
| // @param {String} [$mode:round] (round|ceil|floor) How to round a number | |
| // @return {Number} A rounded number | |
| // @example | |
| // decimal-round(0.333) => 0 |
| if (Meteor.is_client) { | |
| Template.hello.greeting = function () { | |
| return "Welcome to XYZ."; | |
| }; | |
| Template.hello.events = { | |
| 'click input' : function () { | |
| // template data, if any, is available in 'this' | |
| if (typeof console !== 'undefined') | |
| console.log("You pressed the button"); |