This file contains 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
// Restorer holds a function that can be used | |
// to restore some previous state. | |
type Restorer func() | |
// Restore restores some previous state. | |
func (r Restorer) Restore() { | |
r() | |
} | |
// Patch sets the value pointed to by the given destination to the given |
This file contains 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 main | |
import ( | |
"fmt" | |
"log" | |
) | |
//Basic interface to be enriched | |
type GreetingsBot interface { | |
DoHail(name string) (string, error) |
This file contains 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
//Generates variations of elements | |
//in submissionFiles array without repeating. | |
//output is array with tuples | |
for i := 0; i < len(submissionFiles); i++ { | |
for j := i + 1; j < len(submissionFiles); j++ { | |
tuple := OutputComparisonResult{ | |
Files: []string{submissionFiles[i], submissionFiles[j]}, | |
} | |
output = append(output, tuple) | |
} |
This file contains 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
# | |
# Nautilus | |
# | |
# Use list view by default | |
gsettings set org.gnome.nautilus.preferences default-folder-viewer "list-view" | |
# Sort files by type | |
gsettings set org.gnome.nautilus.preferences default-sort-order "type" |
This file contains 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
// with no parameter | |
() -> System.out.println("Hello, world.") | |
// with a single parameter (This example is an identity function). | |
a -> a | |
// with a single expression | |
(a, b) -> a + b | |
// with explicit type information |
This file contains 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
//Old School | |
List<Transaction> groceryTransactions = new Arraylist<>(); | |
for(Transaction t: transactions){ | |
if(t.getType() == Transaction.GROCERY){ | |
groceryTransactions.add(t); | |
} | |
} | |
Collections.sort(groceryTransactions, new Comparator(){ | |
public int compare(Transaction t1, Transaction t2){ | |
return t2.getValue().compareTo(t1.getValue()); |
This file contains 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
go test -coverprofile cover.out | |
go tool cover -html=cover.out -o cover.html |
This file contains 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
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2"> | |
<deployment> | |
<exclusions> | |
<module name="org.apache.commons.logging" /> | |
<module name="org.apache.log4j" /> | |
<module name="org.jboss.logging" /> | |
<module name="org.jboss.logging.jul-to-slf4j-stub" /> | |
<module name="org.jboss.logmanager" /> | |
<module name="org.jboss.logmanager.log4j" /> | |
<module name="org.slf4j" /> |
This file contains 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
BUILDPATH=$(CURDIR) | |
GO=$(shell which go) | |
GOBUILD=$(GO) build | |
GOCLEAN=$(GO) clean | |
GOGET=$(GO) get | |
EXENAME=main | |
export GOPATH=$(CURDIR) |
This file contains 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
deployment-overlay add --name=myOverlay --content=/WEB-INF/web.xml=/myFiles/myWeb.xml,/WEB-INF/ejb-jar.xml=/myFiles/myEjbJar.xml --deployments=test.war,*-admin.war --redeploy-affected |
OlderNewer