This file contains hidden or 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 | |
relname AS TableName, | |
to_char(seq_scan, '999,999,999,999') AS TotalSeqScan, | |
to_char(idx_scan, '999,999,999,999') AS TotalIndexScan, | |
to_char(n_live_tup, '999,999,999,999') AS TableRows, | |
pg_size_pretty(pg_relation_size(relname :: regclass)) AS TableSize | |
FROM pg_stat_all_tables | |
WHERE schemaname = 'public' | |
AND 50 * seq_scan > idx_scan -- more then 2% | |
AND n_live_tup > 10000 |
This file contains hidden or 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
FROM alpine:3.7 | |
MAINTAINER Tommy Muehle <[email protected]> | |
ENV COMPOSER_HOME /composer | |
ENV COMPOSER_ALLOW_SUPERUSER 1 | |
ENV PATH /composer/vendor/bin:$PATH | |
RUN apk --update --progress --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.7/community add \ | |
curl \ | |
php7 \ |
This file contains hidden or 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 events | |
import ( | |
"sync" | |
"context" | |
) | |
type Dispatcher struct { | |
mutex *sync.RWMutex | |
listeners map[string][]Listener |
This file contains hidden or 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 main | |
import ( | |
"context" | |
"log" | |
"cloud.google.com/go/pubsub" | |
) | |
func main() { |
This file contains hidden or 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 My\App; | |
class CacheWarmer | |
{ | |
private $cacheDirectory; | |
public function __construct(string $cacheDirectory) | |
{ |
This file contains hidden or 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] | |
;;;;;;;;;;;;;;;;;;; | |
; About php.ini ; | |
;;;;;;;;;;;;;;;;;;; | |
; PHP's initialization file, generally called php.ini, is responsible for | |
; configuring many of the aspects of PHP's behavior. | |
; PHP attempts to find and load this configuration from a number of locations. | |
; The following is a summary of its search order: |
This file contains hidden or 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 | |
require __DIR__ . '/../vendor/autoload.php'; | |
use Composer\Script\Event; | |
use Composer\IO\ConsoleIO; | |
use Symfony\Component\Console\Input\ArrayInput; | |
use Symfony\Component\Console\Output\ConsoleOutput; | |
use Symfony\Component\Console\Helper\HelperSet; | |
use Tooly\ScriptHandler; |
This file contains hidden or 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 | |
messages=("Encrypt / ... Waiting" "Create bitcoin ... Waiting" "Format disk ... Waiting" "Copy all emails ... Waiting" "Update passwords ... Waiting") | |
echo ${messages[$RANDOM % ${#messages[@]} ]} | |
sleep 2000 |
This file contains hidden or 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 bash | |
while read oldrev newrev refname | |
do | |
BRANCH=$(git rev-parse --symbolic --abbrev-ref $refname) | |
if [[ "$BRANCH" =~ ^hotfix/* ]]; then | |
echo " /===============================" | |
echo " | HOTFIX DETECTED ..." | |
GIT_WORK_TREE=/tmp git checkout master -f -q | |
GIT_WORK_TREE=/tmp git merge $BRANCH -q --comit -m "Merge $BRANCH" --no-ff |
This file contains hidden or 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 bash | |
PHP=/usr/local/opt/php70/bin/php | |
ARGUMENTS="--ignore-platform-reqs --optimize-autoloader" | |
EXCLUDE_COMMANDS=(init selfupdate dumpautoload diagnose) | |
for item in "${EXCLUDE_COMMANDS[@]}"; do | |
if [[ $1 == "$item" ]]; then ARGUMENTS=""; fi | |
done | |
echo "Running composer with $($PHP -v)" |
NewerOlder