😮
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 | |
declare(strict_types=1); | |
interface Set extends Countable, IteratorAggregate | |
{ | |
public function add(...$members): void; | |
public function remove(...$members): void; | |
public function contains(...$members): bool; | |
public function clear(): void; |
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
/** | |
* Labels Gmail email threads | |
*/ | |
function labelGithubEmails() { | |
/** | |
* Gmail label names for GitHub messages | |
*/ | |
const githubLabelName = 'GitHub' | |
const githubPullRequestLabelName = 'GitHub/Pull Request' | |
const githubIssueLabelName = 'GitHub/Issue' |
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 sh | |
# | |
# Check the name of the deleted users in your Slack organization using `jq` | |
# | |
# Requires: | |
# - curl (https://curl.haxx.se/) | |
# - jq (https://stedolan.github.io/jq/) | |
set -u -o pipefail |
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 sh | |
# | |
# Requires homebrew (http://brew.sh/) | |
# Thanks http://clubmate.fi/upgrade-to-bash-4-in-mac-os-x/ | |
brew update && brew install bash && sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells' && chsh -s /usr/local/bin/bash |
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
# Using GNU `grep` | |
git diff --diff-filter=ACMRTUXB --name-only branch_to_compare | xargs grep -l -P "copyright(\s+)(?!("$(date '+%Y')"))[0-9]{4}" |
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
# Get the size meta of every accessible schema | |
SELECT | |
count(*) tables, | |
`table_schema`, | |
format(sum(`table_rows`)/1000000, 3) `rows (M)`, | |
format(sum(`data_length`)/(1024*1024*1024), 3) `data_size (GB)`, | |
format(sum(`index_length`)/(1024*1024*1024), 3) `index_size (GB)`, | |
format((sum(`data_length`+`index_length`))/(1024*1024*1024), 3) `total_size (GB)`, | |
format(sum(`index_length`)/sum(`data_length`), 3) `index_data_ratio` | |
FROM |
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 | |
class CircularIterator extends IteratorIterator { | |
public function next() | |
{ | |
parent::next(); | |
if (!$this->valid()) { | |
$this->rewind(); | |
} |
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
# Using GNU `sed` | |
git diff --diff-filter=ACMRTUXB --name-only branch_to_compare | xargs sed -i -r "s/copyright(\s+)[0-9]{4}/copyright\1"$(date "+%Y")"/g" |
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 | |
// The location of the EWS WSDL here (Office365 here for example) | |
const WSDL_URL = 'https://outlook.office365.com/EWS/Services.wsdl'; | |
const NAMESPACE_WSDL_PREFIX = 'wsdl'; | |
const NAMESPACE_WSDL_URI = 'http://schemas.xmlsoap.org/wsdl/'; | |
const NAMESPACE_SOAP_PREFIX = 'soap'; | |
const NAMESPACE_SOAP_URI = 'http://schemas.xmlsoap.org/wsdl/soap/'; |
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 | |
// The location of the Unicode CLDR "windowsZones" mappings here | |
const XML_URL = 'http://unicode.org/cldr/data/common/supplemental/windowsZones.xml'; | |
const XML_ZONE_MAP_XPATH = '/supplementalData/windowsZones/mapTimezones/mapZone'; | |
const ZONE_TERRITORY_ATTRIBUTE = 'territory'; | |
const ZONE_IANA_NAME_ATTRIBUTE = 'type'; | |
const ZONE_WINDOWS_NAME_ATTRIBUTE = 'other'; |