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
export class MockFileList implements FileList { | |
[index: number]: File; | |
length: number; | |
private files: File[]; | |
constructor(files: File[]) { | |
this.files = files; | |
this.length = files.length; | |
for (let i = 0; i < files.length; i++) { |
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
#!/bin/bash | |
# Prevent accidental commits to 'master' branch. https://gist.github.com/xnopre/a30946cbacf9d857db6192cb45c860f1 | |
# Commit with -n to bypass this pre-commit hook | |
# Install: | |
# cd path/to/git/repo | |
# curl -fL -o .git/hooks/pre-commit https://gist.githubusercontent.com/xnopre/a30946cbacf9d857db6192cb45c860f1/raw/4a83dcbe17e7a324f7f2773415e7079328caab10/pre-commit | |
# chmod +x .git/hooks/pre-commit | |
BRANCH=`git rev-parse --abbrev-ref HEAD` |
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
'use strict'; | |
// Karma configuration | |
module.exports = function (config) { | |
config.set({ | |
// base path, that will be used to resolve files and exclude | |
basePath: '', | |
// Frameworks to use | |
frameworks: ['jasmine'], |
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
@Entity | |
public Address { | |
// ... other attributes for an address | |
@???(???) | |
public Person person; | |
} |
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
import junit.framework.Assert; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.powermock.api.mockito.PowerMockito; | |
import org.powermock.core.classloader.annotations.PrepareForTest; | |
import org.powermock.modules.junit4.PowerMockRunner; | |
import org.simpleframework.http.core.Container; | |
import org.simpleframework.transport.connect.SocketConnection; |
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
<assembly | |
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> | |
<id>final</id> | |
<baseDirectory>/</baseDirectory> | |
<formats> | |
<format>zip</format> |
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
<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>xno</groupId> | |
<artifactId>test-unpack</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<packaging>pom</packaging> | |
<properties> |
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 xnopre.javasamples; | |
class UserWithEquals { | |
private final String login; | |
private final int month; | |
UserWithEquals(String login, int month) { | |
this.login = login; | |
this.month = month; |
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 xnopre.javasamples; | |
public class TestsEqualsString { | |
public static void main(String[] args) { | |
System.out.println("toto" == "toto"); // true | |
System.out.println("toto".equals("toto")); // true | |
System.out.println(new String("toto") == "toto"); // false | |
String str1 = "toto"; | |
String str2 = "toto"; |
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 xnopre.javasamples; | |
class User { | |
private final String login; | |
private final int month; | |
User(String login, int month) { | |
this.login = login; | |
this.month = month; |