Tutorial by Examples: am

Create folder. Open it in command line. Run npm install webpack -g. Create 2 files: cats.js: define(function(){ return ['dave', 'henry', 'martha']; }); app.js require(['./cats'],function(cats){ console.log(cats); }) Run in command line: webpack ./app.js app.bundle.js Now i...
as written in MDN at July 2016: This feature is not implemented in any browsers natively at this time. It is implemented in many transpilers, such as the Traceur Compiler, Babel or Rollup. So here is example with Babel loader for Webpack: Create folder. Add package.json file there: { &quo...
as written in [MDN][1] at July 2016: This feature is not implemented in any browsers natively at this time. It is implemented in many transpilers, such as the Traceur Compiler, Babel or Rollup. So here is example with Typescript loader for Webpack: //TODO Create simplified version of this ar...
To get this example working, you'll need to create an IIS 7/8 app on your IIS host and add the directory containing the Node.js Web App as the Physical Directory. Ensure that your Application/Application Pool Identity can access the Node.js install. This example uses the Node.js 64-bit installation....
Triggers are an easy way to add some UX responsiveness to your application. One easy way to do this is to add a Trigger which changes a Label's TextColor based on whether its related Entry has text entered into it or not. Using a Trigger for this allows the Label.TextColor to change from gray (when...
For this tutorial, we'll use Entity Framework (EF) Code First to create the back-end database. Web API OData does not require EF. Use any data-access layer that can translate database entities into models. First, install the NuGet package for EF. From the Tools menu, select NuGet Package Mana...
In features/documentation.feature: Feature: Documentation Scenario: User views documentation When I go to the "Cucumber" documentation Then I should see the "Cucumber" documentation A minimal feature has a Feature line and a Scenario with one or more steps begi...
Here’re some basic JUnit annotations you should understand: @BeforeClass – Run once before any of the test methods in the class, public static void @AfterClass – Run once after all the tests in the class has been run, public static void @Before – Run before @Test, public void @After – Run after...
This example will show how to make a simple "Hello User [name]" after the login. The example is based on performing a custom action using a hook From your command line terminal, navigate to your Plugins SDK’s hooks folder. To create a hook project, you must execute the create script. Her...
Create a Laravel application: $ composer create-project laravel/laravel hello-world Navigate to the project folder, e.g. $ cd C:\xampp\htdocs\hello-world Create a controller: $ php artisan make:controller HelloController --resource This will create the file app/Http/Con...
from string import Template data = dict(item = "candy", price = 8, qty = 2) # define the template t = Template("Simon bought $qty $item for $price dollar") print(t.substitute(data)) Output: Simon bought 2 candy for 8 dollar Templates support $-based substitution...
It is very common that during development, one may find very useful to lock/unlock the device screen during specific parts of the code. For instance, while showing a Dialog with information, the developer might want to lock the screen's rotation to prevent the dialog from being dismissed and the cu...
Express var express = require('express'); var app = express(); app.get('/', function (req, res) { res.send('Hello World!'); }); app.listen(3000, function () { console.log('Example app listening on port 3000!'); }); Koa var koa = require('koa'); var app = koa(); app.use(functi...
Commander.js var program = require('commander'); program .version('0.0.1') program .command('hi') .description('initialize project configuration') .action(function(){ console.log('Hi my Friend!!!'); }); program .command('bye [name]') .description('initialize pro...
You can access the exact same context as the method you override. class Boat def initialize(name) @name = name end def name @name end end puts Boat.new("Doat").name # => "Doat" class Boat def name "⛵ #{@name} ⛵" end end ...
Modules can be split across many .js files in the same folder. An example in a my_module folder: function_one.js module.exports = function() { return 1; } function_two.js module.exports = function() { return 2; } index.js exports.f_one = require('./function_one.js'); exports.f_two...
Bootstrap components are a collection of optional jQuery plugins which bundled with Bootstrap. The purpose of Bootstrap components is to provide extended features and capabilities which would be difficult (or impossible) to accomplish without the use of Javascript. Some components provide are pure...
the easiest way is to have the local branch checked out: git checkout old_branch then rename the local branch, delete the old remote and set the new renamed branch as upstream: git branch -m new_branch git push origin :old_branch git push --set-upstream origin new_branch
In this example, we will pause/resume the CountDownTimer based off of the Activity lifecycle. private static final long TIMER_DURATION = 60000L; private static final long TIMER_INTERVAL = 1000L; private CountDownTimer mCountDownTimer; private TextView textView; private long mTimeRemaining; ...
MAPCAR is the most used function of the family: CL-USER> (mapcar #'1+ '(1 2 3)) (2 3 4) CL-USER> (mapcar #'cons '(1 2 3) '(a b c)) ((1 . A) (2 . B) (3 . C)) CL-USER> (mapcar (lambda (x y z) (+ (* x y) z)) '(1 2 3) '(10 20 30) '(1...

Page 71 of 129