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
# Converts 4:3 photos to 16:9. | |
# Useful in order to make smart phone photos look good on a TV (such as in Samsung Ambient mode). | |
# Requires ImageMagick to be installed. | |
for f in ./*.jpg ; do magick "$f" -gravity center -background black -extent 133x100% "${f%.jpg}-wide.jpg" ; done |
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
* Version 3.0.1 (unreleased) | |
** Fix JSONDict not pickling. | |
* Version 3.0.0 (released 2014-10-09) | |
** Complete API rewrite to simplify library significantly. | |
* Version 2.0.0 (released 2014-09-26) | |
** Updated to the latest U2F_V2 standard. | |
** Expose more low level U2F primitives. | |
** Removed old draft versions. |
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
# /etc/X11/Xsession.d/90gpg-agent | |
: ${GNUPGHOME=$HOME/.gnupg} | |
GPGAGENT=/usr/bin/gpg-agent | |
# Original, not working: PID_FILE="$GNUPGHOME/gpg-agent-info-$(hostname)" | |
PID_FILE="$GNUPGHOME/gpg-agent-info" | |
if grep -qs '^[[:space:]]*use-agent' "$GNUPGHOME/gpg.conf" "$GNUPGHOME/options" && |
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 com.smartbear.saas.rs.model; | |
import com.google.common.collect.ImmutableSet; | |
import org.junit.Test; | |
import java.util.Set; | |
import static org.hamcrest.Matchers.equalTo; | |
import static org.hamcrest.Matchers.is; | |
import static org.junit.Assert.*; |
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 com.smartbear.saas.rs.storage; | |
import com.github.fakemongo.Fongo; | |
import com.mongodb.util.JSONSerializers; | |
import org.jongo.Jongo; | |
import org.jongo.MongoCollection; | |
import org.junit.Test; | |
import static java.util.stream.Collectors.joining; |
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
class TestRunResource | |
{ | |
private final TestQueue testQueue; | |
private final TestStorage testStorage; | |
public void stopTestRun( @Auth User user, @PathParam( "id" ) String testId ) | |
{ | |
TestRun test = getTestRun( user, testId ); // gets testrun from testStorage | |
testQueue.abort( test ); | |
test.abort(); |
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
/* | |
* When a Task is aborted, it should b aborted in the taskQueue and its state should be | |
* persisted to taskStorage. There is also a start method with similar requirements. | |
* | |
* Below are different implementation alternatives for a REST method. | |
*/ | |
// Alt. 1 -- Task knows about taskStorage and taskQueue: | |
taskStorage.getTask( id ).abort().save(); |
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
/////////////////////// There's an infitite loop hidden in this code //////////////////////////// | |
class Foo | |
{ | |
private final HashMap<String, Integer> scores = new HashMap<>(); | |
synchronized resetCount( String name ) | |
{ | |
scores.put( name, 0 ); | |
} |
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
class RequestRunnerExecutor | |
{ | |
private final Set<HttpWebResponse> runningRequests = new HashSet<>(); | |
public ListenableFuture<Boolean> runRequest( URI uri ) | |
{ | |
final Future<HttpWebResponse> futureResponse = httpClient.execute( | |
HttpAsyncMethods.createGet( uri ), | |
new ByteConsumer(), | |
new ResponseCallback() |
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
class Foo { | |
private Helper helper = null; | |
public Helper getHelper() { | |
if (helper == null) { | |
synchronized (this) { | |
if (helper == null) { | |
helper = new Helper(); | |
} | |
} |
NewerOlder