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 | |
perl -ne 'print if ($seen{$_} .= @ARGV) =~ /10$/' <(git rev-list --ancestry-path $1..$2) <(git rev-list --first-parent $1..$2) | tail -n 1 | xargs -l git show --stat |
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
SELECT @@max_heap_table_size; | |
SET GLOBAL max_heap_table_size = 1024 * 1024 * 1024 * 2; | |
SET max_heap_table_size = 1024 * 1024 * 1024 * 2; |
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
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST where COMMAND <> 'Sleep' \G |
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/sh | |
# convert line | |
echo "fff" | php -r '$id = stream_get_contents(STDIN); $id[0] = dechex(15 - hexdec($id[0])); echo $id . PHP_EOL;' | |
# convert file | |
head log.csv | xargs -L 1 | xargs -I{} php -r '$id = "{}"; $id[0] = dechex(15 - hexdec($id[0])); echo $id . PHP_EOL;' |
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 | |
cat domains.csv | xargs -I{} bash -c 's=$(GET -ds "https://{}"); if [[ $s != "200 OK" ]]; then echo {}; fi' |
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 | |
test="a78b"; regex="([0-9]+)"; if [[ $test =~ $regex ]]; then echo ${BASH_REMATCH[1]}; else echo "not equals"; fi |
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
// For Windows 32 | |
// i686-w64-mingw32-g++-win32 -static-libstdc++ -static-libgcc -o hackme_win32.exe hackme.cpp | |
// wine hackme_win32.exe | |
// For Windows 64 | |
// x86_64-w64-mingw32-g++ -static-libstdc++ -static-libgcc -o hackme_win64.exe hackme.cpp | |
// wine hackme_win64.exe | |
#include <iostream> | |
int main() { |
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 | |
class Amount | |
{ | |
public function getFormattedAmount($locale, $currency) | |
{ | |
$formatter = new \NumberFormatter($locale, \NumberFormatter::CURRENCY); | |
return $formatter->formatCurrency($this->amount, $currency); | |
} | |
} |
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
find . -name "someFile.po" \ | |
| grep someSourceDir \ | |
| xargs -I{} sh -c 'old={}; new=$(echo $old | sed "s/someFile.po/someNewFile.po/g"); cp $old $new' |
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 | |
namespace Sokil\EventListener; | |
use Symfony\Component\HttpKernel\Event\GetResponseEvent; | |
use Symfony\Component\HttpKernel\KernelEvents; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
class JsonRequestListener implements EventSubscriberInterface | |
{ |