Skip to content

Instantly share code, notes, and snippets.

View tonivdv's full-sized avatar

Toni Van de Voorde tonivdv

View GitHub Profile
@miguelmota
miguelmota / auth.json
Created February 21, 2019 03:08
AWS Cognito Identity authenticate using cURL
{
"AuthParameters" : {
"USERNAME" : "alice@example.com",
"PASSWORD" : "mysecret"
},
"AuthFlow" : "USER_PASSWORD_AUTH",
"ClientId" : "9..............."
}
@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
@DavidWells
DavidWells / conditional-resources.yml
Last active June 28, 2021 15:46
Using conditional "Fn::Equals" for cloudformation resources. From https://github.com/KlickMarketing/demo-site/blob/master/serverless.yml#L55 including no value
resources:
Description: Demo Site
Conditions:
isProd: {"Fn::Equals" : ["${self:custom.stageFlag}", "prod"]}
isRC: {"Fn::Equals" : ["${self:custom.stageFlag}", "rc"]}
isDev: {"Fn::Equals" : ["${self:custom.stageFlag}", "dev"]}
isProdOrRC: {"Fn::Or": [{"Condition": "isProd"}, {"Condition": "isRC" }]}
Resources:
ProxyEntry:
Type: 'Custom::MarketingStackProxyEntry'
@dwelch2344
dwelch2344 / kafka-consumer.test.js
Created October 2, 2018 20:05
kafka avro nodejs example
const registryUrl = 'http://schema-registry:8081'
const avro = require('avsc')
const registry = require('avro-schema-registry')(registryUrl)
const kafka = require('kafka-node')
const client = new kafka.KafkaClient({ kafkaHost: 'kafka:9092' })
const topic = {
topic: 'actor7',
offset: 3695
@seanhandley
seanhandley / docker-compose.yml
Last active June 7, 2024 19:25
How To Set Up Docker For Mac (Mojave) with Native NFS
version: '2'
services:
api:
volumes:
- "nfsmount:${CONTAINER_DIR}"
volumes:
nfsmount:
driver: local
driver_opts:
@GhazanfarMir
GhazanfarMir / Instructions.sh
Last active May 14, 2024 03:26
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@jeshan
jeshan / cognito.yaml
Created February 4, 2018 08:18 — forked from singledigit/cognito.yaml
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
@tknerr
tknerr / ci_jobs.groovy
Created January 18, 2018 10:21
Example JobDSL for a multibranchPipelineJob which keeps only the last 10 builds
// define the bitbucket project + repos we want to build
def bitbucket_project = 'myproj'
def bitbucket_repos = ['myrepo1', 'myrepo2']
// create a pipeline job for each of the repos and for each feature branch.
for (bitbucket_repo in bitbucket_repos)
{
multibranchPipelineJob("${bitbucket_repo}-ci") {
// configure the branch / PR sources
branchSources {
MAX_BUILDS = 5
MAX_ENV_BUILDS = 2
Jenkins.instance.getAllItems(org.jenkinsci.plugins.workflow.job.WorkflowJob.class).each { it ->
def job = Jenkins.instance.getItemByFullName(it.fullName, Job.class)
def limit = (it.fullName =~ /^environment/) ? MAX_ENV_BUILDS : MAX_BUILDS
def recent = job.getBuilds().limit(limit)
println "Processing job " + it.fullName + " " + it.class + " BuildCount: " + job.getBuilds().size() + " Limit: " + limit
@yannbertrand
yannbertrand / using_xdebug_with_postman.md
Created December 6, 2016 15:04
Using xDebug with POSTMAN

Set the url with ?XDEBUG_SESSION_START=PHPSTORM and set a header Cookie: XDEBUG_SESSION=PHPSTORM