Skip to content

Instantly share code, notes, and snippets.

View aklinkert's full-sized avatar

Alex Klinkert aklinkert

  • Hamburg
View GitHub Profile
@roylines
roylines / remote-terraform-s3-policy
Created September 19, 2015 10:46
IAM policy to allow storing of remote terraform state in S3
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:*"
],
"Resource": [
"arn:aws:s3:::my.bucket",
@achmadfatoni
achmadfatoni / slug-validation.php
Created September 8, 2016 03:36
Laravel slug validation
Validator::extend('slug', function($attribute, $value, $parameters, $validator) {
return preg_match('/^[a-z0-9]+(?:-[a-z0-9]+)*$/', $value);
});
@daliborgogic
daliborgogic / delay.js
Created December 16, 2016 15:26
Node.js Async/Await delay
'use strict'
const timeout = ms => new Promise(res => setTimeout(res, ms))
function convinceMe (convince) {
let unixTime = Math.round(+new Date() / 1000)
console.log(`Delay ${convince} at ${unixTime}`)
}
async function delay () {
@stvnwrgs
stvnwrgs / pushb
Last active June 2, 2022 13:57
A small script to send push notifications to your phone when a job is done
#! /bin/bash
#################### Usage
#
# 1. Register an account on https://www.pushbullet.com/
# 2. Add devices
# 3. Create an access token https://www.pushbullet.com/#settings/account
# 4. save it to your bash profile $PUSHBULLET_API_TOKEN
# 5. Re-source, Execute the following (you can remove jq):
#