Skip to content

Instantly share code, notes, and snippets.

git fetch origin master
git checkout -b main origin/master --no-track
git push origin main
git remote set-head origin main
gh api -XPATCH "repos/:owner/:repo" -f default_branch="main"
git push --delete origin master
git branch -d master
#!ipxe
set base-url http://stable.release.core-os.net/amd64-usr/current
kernel ${base-url}/coreos_production_pxe.vmlinuz initrd=coreos_production_pxe_image.cpio.gz
initrd ${base-url}/coreos_production_pxe_image.cpio.gz
boot
var lazy = require("lazy"),
fs = require("fs");
new lazy(fs.createReadStream('./data.txt'))
.lines
.forEach(function(line) {
console.log(line.toString());
}
);
$ bin/behat
Feature: Simple Calculator
Scenario: Addition # features/SimpleCalculator.feature:3
[2013-02-03 16:33:34] FeatureContext.INFO: Initialised calculator ["stdClass"] []
Given I have a calculator # FeatureContext::iHaveACalculator()
[2013-02-03 16:33:34] AdditionContext.INFO: Adding values ["2","3"] []
When I add together "2" and "3" # AdditionContext::iAddTogetherAnd()
[2013-02-03 16:33:34] FeatureContext.INFO: Asserting expected result "5" equals "5" [] []
Then the result should be "5" # FeatureContext::theResultShouldBe()
@swestcott
swestcott / gist:3172927
Created July 24, 2012 21:55
Behat Multi Session - Use Chat Room
<?php
/**
* @When /^"([^"]*)" posts a message$/
*/
public function postsAMessage($user)
{
// Ensure message is unique
$this->message = 'Selenium Test ' . microtime(true);
$this->getSession($user)->getPage()->fillField("chat", $this->message);
@swestcott
swestcott / gist:3172857
Created July 24, 2012 21:42
Behat Multi Session - Enter Chat Room
<?php
/**
* @Given /^"([^"]*)" enters the chat room$/
*/
public function entersTheChatRoom($user)
{
if(is_null($this->defaultDriver)) {
$this->defaultDriver = $this->getSession()->getDriver();
}
@swestcott
swestcott / behat.yml.dist
Created July 2, 2012 21:50
Behat + WebDriver + SauceLabs
saucelabs:
context:
extensions:
Behat\MinkExtension\Extension:
selenium2:
browser: iexplore
wd_host: username:password@ondemand.saucelabs.com/wd/hub
capabilities: { "platform": "VISTA", "browser": "iexplore", "version": "9"}
default:
context:
extensions:
Behat\MinkExtension\Extension:
base_url: http://en.wikipedia.org/
default_session: selenium2
javascript_session: selenium2
selenium2:
browser: chrome
wd_host: foo:bar@ondemand.saucelabs.com/wd/hub
@swestcott
swestcott / gist:2732669
Created May 19, 2012 22:47
MinkExtension example
simon@mac:MinkExtension-example (master)$ bin/behat
Feature: Search
In order to see a word definition
As a website user
I need to be able to search for a word
Scenario: Searching for a page that does exist # features/search.feature:6
Given I am on "/wiki/Main_Page" # InheritedFeatureContext::visit()
When I fill in "search" with "Behavior Driven Development" # InheritedFeatureContext::fillField()
And I press "searchButton" # InheritedFeatureContext::pressButton()
public class BuildAllAction implements RootAction {
private static final Logger LOGGER = Logger.getLogger(BuildAllAction.class.getName());
public String getIconFileName() {
return "doesnotexist";
}
public String getDisplayName() {
return "Build All";