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
#!/usr/bin/env php | |
<?php declare(strict_types = 1); | |
$command = array_shift($argv); | |
if (3 !== count($argv)) { | |
echo <<<USAGE | |
Usage: $command path/to/composer.json path/to/phpunit.xml path/to/slice.xml > new_phpunit.xml | |
Based on your composer PSR-4 autoload configuration, the classes referenced |
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 declare(strict_types=1); | |
/* | |
Usage: php endomondo_json2gpx.php <path_to_file.json> […<path_to_other_file.json>] | |
The endomondo json format parsed here; only the fields actually used by this converted: | |
[ | |
{"sport": "…"}, |
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
#!/usr/bin/env php | |
<?php declare(strict_types = 1); | |
// Source: https://gist.github.com/mfn/256636242cbe8a51252ce28181a6b074 | |
$command = array_shift($argv); | |
if (2 !== count($argv)) { | |
echo "Please provide a XML file and a slice like `$command tests.xml 2/4`\n"; |
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
<!-- challenge description: | |
- a given set of infinite poker chips in theses sizes: 500, 100, 50, 25, 10, 5, 2, 1 | |
- enter a number | |
- tell the user the minimum number of chips necessary to represent the value | |
--> | |
<!-- initial 91 char solution ; thx to @neuling for the inspiration and @johannesnagl saving me one extra char --> | |
<p onclick="i=prompt();for(a of[500,100,50,25,10,5,2,1])if(e=~~(i/a))alert(e+' '+a,i%=a)">. | |
<!-- since it wasn't specified that spitting out 0 chips would be prohibited, another solution --> |
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
#!/usr/bin/env php | |
<?php | |
/** | |
* Filters MySQL dumps to remove FULLTEXT index creation from stdin to stdout. | |
* | |
* Has logic to adjust the line *before* the FULLTEXT to not create invalid SQL. | |
* | |
* @author Markus Fischer <markus@fischer.name> | |
* @license Do what you want, credit but don't blame me | |
*/ |
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
set -g default-terminal "screen-256color" | |
# Behave like screen; at least the stuff I use | |
unbind-key C-b | |
set-option -g prefix C-a | |
bind-key C-a last-window | |
set-window-option -g mode-keys vi | |
# Make window splitting more intuitive | |
unbind % | |
bind-key | split-window -h |
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
(function() { | |
var | |
someVariable = { | |
foo: 42 | |
}, | |
someString = 'Well hello there.', | |
someOtherVariable = { | |
isThisVeryConfusing: true | |
}, |
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
(function() { | |
var someVariable = { | |
foo: 42 | |
}, | |
someString = 'Well hello there.', | |
someOtherVariable = { | |
isThisVeryConfusing: true | |
}, | |
// okay, please imagine 200 more lines of more declarations here |
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
diff --git a/lib/logstash/outputs/redis.rb b/lib/logstash/outputs/redis.rb | |
index 7aab4f2..cb5c4aa 100644 | |
--- a/lib/logstash/outputs/redis.rb | |
+++ b/lib/logstash/outputs/redis.rb | |
@@ -148,10 +148,11 @@ class LogStash::Outputs::Redis < LogStash::Outputs::Base | |
# if they fail to convert properly. | |
begin | |
payload = event.to_json | |
- rescue Encoding::UndefinedConversionError, ArgumentError | |
+ rescue Exception => e |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<scheme name="Elite_Matrix" version="124" parent_scheme="Default"> | |
<option name="LINE_SPACING" value="1.0" /> | |
<option name="EDITOR_FONT_SIZE" value="14" /> | |
<option name="CONSOLE_FONT_NAME" value="Monospaced" /> | |
<option name="CONSOLE_FONT_SIZE" value="12" /> | |
<option name="EDITOR_FONT_NAME" value="Consolas" /> | |
<colors> | |
<option name="CARET_COLOR" value="db33" /> | |
<option name="CARET_ROW_COLOR" value="90" /> |
NewerOlder