Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
UPTIMEROBOT_TOKEN="uptimerobot-token-here"
OHDEAR_TOKEN="ohdear-token-here"
OHDEAR_TEAM_ID=123456789
OFFSET=0
LIMIT=50
TOTAL=1000000
@rskuipers
rskuipers / detect-custom-fields.sh
Created March 4, 2020 21:57
Detect logins with custom fields in your bitwarden vault
#!/bin/bash
# Download and install bitwarden CLI: https://help.bitwarden.com/article/cli/
# First login to access your vault:
# $ bw login
# Export the session variable as explained in the login output:
# export BW_SESSION="..."
for row in $(bw list items --organizationid null | jq -r '.[] | @base64'); do
row=$(echo "$row" | base64 -d -)
@rskuipers
rskuipers / move-to-personal-folder.sh
Created March 4, 2020 21:34
Move all items in bitwarden vault that don't belong to an organization to your personal folder
#!/bin/bash
# Download and install bitwarden CLI: https://help.bitwarden.com/article/cli/
# First login to access your vault:
# $ bw login
# Export the session variable as explained in the login output:
# export BW_SESSION="..."
# Get personal folder ID with:
# $ bw list folders
# Change personal folder id below
@rskuipers
rskuipers / Makefile
Created January 28, 2019 13:32
Hybrid Makefile
.PHONY: *
docker := $(shell if [ `pwd` != "/app" ]; then echo 'docker-compose exec php'; fi;)
fix-cs:
${docker} ./vendor/bin/php-cs-fixer fix
analyse:
${docker} ./vendor/bin/php-cs-fixer fix --diff --dry-run
${docker} ./vendor/bin/phpstan analyse
@rskuipers
rskuipers / JSON-JavaScript.json.js
Last active July 30, 2018 18:05
Custom extractor for PhpStorm to extract database tables as JSON
function eachWithIdx(iterable, f) { var i = iterable.iterator(); var idx = 0; while (i.hasNext()) f(i.next(), idx++); }
function mapEach(iterable, f) { var vs = []; eachWithIdx(iterable, function (i) { vs.push(f(i));}); return vs; }
function output() { for (var i = 0; i < arguments.length; i++) { OUT.append(arguments[i]); } }
var rows = [];
eachWithIdx(ROWS, function (row) {
var obj = {};
eachWithIdx(COLUMNS, function (col) {
var value = FORMATTER.format(row, col);
<?php
// This file is not a CODE, it makes no sense and won't run or validate
// Its AST serves IDE as DATA source to make advanced type inference decisions.
namespace PHPSTORM_META {
$STATIC_METHOD_TYPES = [
\Zend\ServiceManager\ServiceLocatorInterface::get('') => [
// STATIC call key to make static (1) & dynamic (2) calls work
"special" instanceof \Exception,
// "KEY" instanceof Class maps KEY to Class
@rskuipers
rskuipers / improve-zs.js
Created May 4, 2016 07:04
Improve Zend Server Job Queue table
(function () {
var app = document.getElementById('Application'),
url = document.getElementById('URL'),
name = document.getElementById('Name'),
server = document.getElementById('Server');
app.setAttribute('originalWidth', '0');
app.style.width = '0px';
url.setAttribute('originalWidth', '5%');
@rskuipers
rskuipers / psql-to-csv.php
Created April 29, 2016 09:46
Sometimes you don't have the access to do a nice COPY
<?php
$psqlDelimiter = '|';
$outputDelimiter = ';';
$file = new SplFileObject(__DIR__ . '/psql.csv');
$output = new SplFileObject(__DIR__ . '/output.csv', 'w');
$i = 0;
while (!$file->eof()) {
<?php
class ValidationFlow
{
/**
* @var ValidationStep[]
*/
private $steps = [];
/**
git log v1.0.0..v1.1.0 --pretty=oneline | grep -oE "PRJ-[0-9]+" | sort | uniq | xargs | sed 's/ /,/g'