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
# Remember to chmod +x | |
while true; do | |
echo -n . | |
HTTP_CODE=$(curl --silent -I -X GET https://tickets.sibir-arena.ru/ | head -1 | awk '{print $2}') | |
[[ 200 = $HTTP_CODE ]] && break | |
sleep 15 | |
done | |
notify-send "Sibir arena alive!" |
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 | |
### BEGIN INIT INFO | |
# Provides: traccar | |
# Required-Start: $local_fs $remote_fs $network $syslog $named | |
# Required-Stop: $local_fs $remote_fs $network $syslog $named | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Modern GPS Tracking Platform | |
# Description: Manages traccar server for getting device's data and showing at web-interface | |
### END INIT INFO |
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 | |
// | |
// To use this file run this: | |
// git config --global sequence.editor git-commit-file.php | |
// | |
// Then just: | |
// git rebase -i develop | |
// |
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 | |
function log { | |
echo | |
echo "-- $1 --" | |
} | |
function run { | |
echo "# $1" | |
sh -c "$1" |
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 | |
function vtt_concat($t1, $t2) { | |
for ($i = 1; $i < strlen($t1); $i++) { | |
$t1_part = substr($t1, -$i); | |
$t2_has_t1_part = (strstr($t2, $t1_part) !== false); | |
if ($t2_has_t1_part) { | |
continue; | |
} elseif ($i == 1) { | |
break; |
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 | |
$options = getopt('', [ | |
'url:', | |
'first-comment-to:' | |
]); | |
if (empty($options['url']) || empty($options['first-comment-to'])) { | |
exit('Parameters: --url=https://vk.com/sibhl?w=wall-96808993_127304 --first-comment-to=00:00:00'.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
<?php | |
// @see https://www.sitepoint.com/creating-strictly-typed-arrays-collections-php/ | |
class Wtf | |
{ | |
public function wow() | |
{ | |
echo __METHOD__; | |
} | |
} |
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"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:template match="/metrics"> | |
<html> | |
<body> | |
<style> | |
body { font-family: consolas; } | |
ul.methods { -webkit-column-count: 3; } | |
sup { margin: 0 0.2em; font-weight: normal; padding: 0.4em 0.3em; background: gainsboro; color: gray; } | |
.position-top-20 { color: red; } |
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
/** | |
* Transforms "Vendor\FooBundle\Command\BarCommand" transforms to "vendor_foo.command.bar" id | |
* | |
* @param string $className | |
* @return string | |
*/ | |
private function convertClassToId($className) | |
{ | |
$id = preg_replace('/^(\w+)\\\(\w+)Bundle.*\\\(\w+)(Command)$/', '$1_$2.$4.$3', $className); |
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 Vendor\AppBundle\DependencyInjection; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\Config\FileLocator; | |
use Symfony\Component\DependencyInjection\Loader; | |
use Symfony\Component\HttpKernel\DependencyInjection\Extension; | |
class VendorAppExtension extends Extension | |
{ |
NewerOlder