Skip to content

Instantly share code, notes, and snippets.

View janyksteenbeek's full-sized avatar

Janyk Steenbeek janyksteenbeek

View GitHub Profile
@janyksteenbeek
janyksteenbeek / scrapePostsProductForums.js
Created February 11, 2016 21:39
Grab your latest post count from the Google Product Forums using PhantomJS
"use strict";
function waitFor(testFx, onReady, timeOutMillis) {
var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 3000, //< Default Max Timout is 3s
start = new Date().getTime(),
condition = false,
interval = setInterval(function() {
if ( (new Date().getTime() - start < maxtimeOutMillis) && !condition ) {
condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()); //< defensive code
} else {
@janyksteenbeek
janyksteenbeek / resolveC.php
Last active April 11, 2016 18:34
Resolve /c/username YouTube URLs to Channel ID
<?php
/**
* /c/ resolver
* @author Janyk Steenbeek <info@janyksteenbeek.nl>
* @license All rights reserved
* @url https://www.janyksteenbeek.nl
*/
// Setting appropriate headers
header("Access-Control-Allow-Origin: *");
@janyksteenbeek
janyksteenbeek / fprooster.60s.sh
Created June 20, 2016 00:14
[BitBar] FPRooster: Volgende les
#!/bin/bash
# <bitbar.title>FPRooster: Volgende les</bitbar.title>
# <bitbar.version>v1.0.0</bitbar.version>
# <bitbar.author>Janyk Steenbeek</bitbar.author>
# <bitbar.author.github>janyksteenbeek</bitbar.author.github>
# <bitbar.desc>Toont de volgende les binnen je rooster.</bitbar.desc>
Spec="SEIT"
Class="I4O2A"
@janyksteenbeek
janyksteenbeek / vat_rates.php
Last active December 9, 2016 18:50 — forked from sergejmueller/vat_rates.php
List of EU Countries (ISO-3166-2) with equivalent EU VAT Rates
$vat_rates = [
'AT' => 20, // Austria
'BE' => 21, // Belgium
'BG' => 20, // Bulgaria
'HR' => 25, // Croatia
'CY' => 19, // Cyprus
'CZ' => 21, // Czech Republic
'DK' => 25, // Denmark
'EE' => 20, // Estonia
'FI' => 24, // Finland
@janyksteenbeek
janyksteenbeek / formatcopyrighttakedown.php
Created January 2, 2017 20:35
Auto-format a free-form YT copyright infringement notice
<?php
/**
* Stolen video title matcher
* @author Janyk Steenbeek <janyk.steenbeek@alveum.net>
* @license All rights reserved
* @url https://www.alveum.net
*/
$stolenPlaylistId = 'UUPu7aiZRcOSgKso6cNjZSag';
$key = 'YOUTUBE_API_KEY';
@janyksteenbeek
janyksteenbeek / keybase.md
Created September 12, 2019 11:49
Keybase proof @janyksteenbeek 2019-09-12

Keybase proof

I hereby claim:

  • I am janyksteenbeek on github.
  • I am janyksteenbeek (https://keybase.io/janyksteenbeek) on keybase.
  • I have a public key ASAF93-ggdtzy-EiSxROZRiFoXEAN0IuVt-HDFOU_lVfcQo

To claim this, I am signing this object:

@janyksteenbeek
janyksteenbeek / ciscodna_webhook_slack.php
Last active October 8, 2021 13:07
Report Cisco DNA web hook alerts to Slack
<?php
// Setting up Slack Webhook URI
$slackUrl = 'https://hooks.slack.com/services/HIER_JE_WEBHOOK_URL';
$ciscoDnaUrl = 'https://DNA_IP/'; // Always add trailing slash
$ciscoRequest = json_decode(file_get_contents('php://input'));
// Checking wheter or not is a valid Cisco DNS webhook
@janyksteenbeek
janyksteenbeek / laravel-pint.yml
Last active December 23, 2022 15:20
Run Laravel Pint on PRs towards `main` with GitHub Actions and auto-commit changes (.github/workflows/laravel-pint.yml)
# .github/workflows/laravel-pint.yml
# -- Be sure to add `laravel/pint` to your require-dev in your composer.json
name: Format Code using Laravel Pint
on:
pull_request:
branches:
- main
jobs:
@janyksteenbeek
janyksteenbeek / tests.yaml
Last active November 11, 2022 11:44
GitHub Actions yaml file for running PHP tests (.github/workflows/tests.yaml)
# .github/workflows/tests.yml
name: Run Tests
on: [push, pull_request]
jobs:
Tests:
runs-on: ubuntu-18.04
strategy:
matrix:
php-versions: ['8.0', '8.1']
steps:
@janyksteenbeek
janyksteenbeek / laravel_cram_migration.php
Last active November 11, 2022 11:42
Laravel Cram Migration utility: This utility is used to cram a newly created Laravel migration file in between two migrations for correct order
<?php
/**
* Cram Migration utility
* ----------------------
*
* This utility is used to cram a newly created Laravel migration file in between two migrations for correct order.
* It is useful when you have a lot of migrations and you want to insert a new one in between.
*
* Make sure your new migration file is named correctly, starting with 9999, e.g. 9999_create_users_table.php
*