Skip to content

Instantly share code, notes, and snippets.

@sdomagala
sdomagala / serverless-with-trust-policy-change.yml
Created February 3, 2020 09:05
Change Trust Policy in Serverless IAM Role (or any other params other than policy)
## all other serverless.yml configuration
functions:
# your functions
provider:
name: aws
# your provider config
resources:
Resources:
@OnlyInAmerica
OnlyInAmerica / delete_iam_users.py
Created May 12, 2015 21:31
Delete old IAM AWS users
import boto.iam
'''
Delete the NUM_USERS_TO_DELETE oldest IAM users in your account*
*IMPORTANT: The boto iam api appears to only allow querying 1000 users
at a time so if you have over 1000 IAM users there is no guarantee these
will be the oldest. The deleted users are only guaranteed to be the oldest
among the 1000 aws returns us.
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active April 2, 2024 02:45
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
<?php
class DefaultController extends Controller
{
/**
* Dashboard page.
* @Permissions(perm="dashboard_view")
* @Route("/", name="ITEDashboardBundle_index")
* @Template()
* @return array