This file contains hidden or 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
package dev.hbrown | |
/** | |
* Demonstrates the importance of limiting the scope of a variable using the Sieve of Eratosthenes to find prime numbers | |
* using a sequence builder. The algorithm is conceptually very easy: | |
* | |
* 1. take a list of numbers starting at 2. | |
* 2. remove the first number, it is prime. | |
* 3. from the rest of the numbers, remove the first number as well as all the numbers divisible by this prime number. | |
* |
This file contains hidden or 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
#!/usr/bin/env kscript | |
var factor = 2 | |
fun doubleIt(n: Int) = n * factor | |
var message = "The factor is $factor" | |
factor = 0 | |
println(doubleIt(2)) | |
println(message) |
This file contains hidden or 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
#!/usr/bin/env groovy | |
/** | |
* Demonstrates how to use Grape to grab dependencies for | |
* Groovy scripts. | |
* | |
* Grape stands for the Groovy Adaptable (Advanced) Packaging Engine, and it is a part of the Groovy installation. | |
* Grape helps you download and cache external dependencies from within your script with a set of simple annotations. | |
* | |
* If, in your script, you require an external dependency, that you know is available in a public repository as Maven Central Repository, |
This file contains hidden or 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
<web-app | |
version="3.1" | |
xmlns="http://xmlns.jcp.org/xml/ns/javaee" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"> | |
<context-param> | |
<param-name>javax.faces.PROJECT_STAGE</param-name> | |
<param-value>Development</param-value> | |
</context-param> | |
<servlet> |
This file contains hidden or 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
#!/usr/bin/env groovy | |
/** | |
* Simple script to create a Groovy project using Gradle | |
*/ | |
def console = System.console() | |
String projectName = console.readLine("What is the name of the project? ") | |
String projectFolderName = projectName.replaceAll(" ", "-").toLowerCase() |
This file contains hidden or 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
<!doctype html> | |
<html ng-app> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> | |
<script> | |
function TodoCtrl($scope) { | |
$scope.todos = [ | |
{text:'learn angular', done:true}, | |
{text:'build an angular app', done:false}]; | |
This file contains hidden or 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
AngulaJS:Person Example |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>AngularJS: Hello World</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script> | |
</head> | |
<body> | |
<div ng-app> | |
<input type="text" ng-model="name" placeholder="Enter your name here..." /> | |
<span ng-show="name">Hello, {{name}}</span> |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.henry.g.brown</groupId> | |
<artifactId>CucumberDemo</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<dependencies> |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="http://jboss.org/schema/arquillian" | |
xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd"> | |
</arquillian> |
NewerOlder