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
private static final Logger LOG = LoggerFactory.getLogger(Example.class); | |
private static final String FMT2 = "with-{}-{}-placeholders"; | |
public static void main(String[] args) { | |
LOG.error("with-'%s'-placeholder", args); | |
LOG.error(FMT2, args); | |
} |
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
static final class StringIsEmpty { | |
@BeforeTemplate | |
boolean equalsEmptyString(String string) { | |
return string.equals(""); | |
} | |
@BeforeTemplate | |
boolean lengthEquals0(String string) { | |
return string.length() == 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
public static void main(String[] args) { | |
if (args.length > 0 && args[0].isEmpty()) { | |
new IllegalArgumentException( ); | |
} | |
// ... rest of the main code ... | |
} |
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 requests | |
from mendeley import Mendeley | |
def get_mendeley_bibtex(login, api_id, api_secret): | |
# login: tuple containing username and password | |
# api_id: Mendeley API id | |
# api_secret: Mendeley API secret | |
# Temporarily disable InsecurePlatformWarnings from urllib3 |
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
' Because inserting cross-references is terrible in Word, these macros | |
' makes life a little easier by selecting the appropriate drop-down boxes | |
' Open issue: NumLock may be disabled | |
Sub InsertFigureReference() | |
' Reference a Figure and insert Only label and number | |
With Application.Dialogs(wdDialogInsertCrossReference) | |
SendKeys "ff{TAB}{DOWN 2}{ENTER}", True | |
.InsertAsHyperLink = 1 | |
.InsertPosition = 0 | |
.Show |
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 DefaultList(list): | |
def __init__(self, factory=None): | |
super(DefaultList, self).__init__() | |
# Check if argument is callable | |
if factory is not None: | |
try: | |
factory() | |
except TypeError as e: | |
raise e | |
self._factory = factory |
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
// ---- | |
// Sass (v3.4.6) | |
// Compass (v1.0.1) | |
// ---- | |
// Margin | |
@mixin margin($top: 0, $right: $top or $left, $bottom: $top, $left: $right or $top) { | |
margin: $top $right $bottom $left; | |
} |
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
<?php | |
// article.php located at /themes/<theme>/article.php | |
// ... | |
// replace | |
echo article_markdown(); | |
// with | |
echo custom_markdown(); | |
// ... |