Skip to content

Instantly share code, notes, and snippets.

View zboralski's full-sized avatar

Anthony Zboralski zboralski

View GitHub Profile
@darktable
darktable / app.yaml
Created March 16, 2011 19:10
GAE: App.yaml designed for serving a static site on Google App Engine (Python). Copy your static html and files into a folder called "static" next to app.yaml. Contains a bunch of mimetype declarations from html5boilerplate's .htaccess. May not be neces
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
@tux21b
tux21b / disruptor.go
Created September 15, 2011 02:22
Disruptor
// Copyright (C) 2011 by Christoph Hack. All rights reserved.
// Use of this source code is governed by the New BSD License.
/*
This program contains a simple micro-benchmark for a Disruptor [1] like
event buffer (or at least what I think that Disruptor might be). There
isn't any kind of API yet and this test is currently limited to a
single producer - single consumer architecture, but generally the
architecture of Disruptor is also well suited for multiple producers and
consumers.
@domenic
domenic / promises.md
Last active November 19, 2024 02:40
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@maxluster
maxluster / responsive.scss
Last active February 4, 2019 21:24
Responsive SASS: Chain media queries and coordinate named breakpoints
// Created by Max Luster (@maxluster)
// Usage instructions at https://bugsnag.com/blog/responsive-typography-with-chained-media-queries
// Requires SASS >= 3.3
// Enhanced by Breakpoint 2.4.x and Compass 1.0 (alpha)
// For SASS 3.2.x support, use https://gist.github.com/maxluster/c9ecc6e4a6770e507c2c
// Provides a simplified syntax for chaining media queries across named or numeric breakpoints
@mixin responsive($properties, $default-value, $responsive-values){
// No named breakpoints by default
@karmatr0n
karmatr0n / bridge.sh
Created August 19, 2014 16:34
Enable Internet access in your WiFi Pineapple through a network bridge and NAT with pf in Mac OS
#!/bin/sh
# You must execute this script with sudo: sudo sh bridge.sh
# Setting the ip address for en0 (ethernet interface) to enable access for pineapple default address: 172.16.42.1
ifconfig en0 172.16.42.2 netmask 255.255.255.0 broadcast 172.16.42.255 up
# Setting the bridge
ifconfig bridge0 create
ifconfig bridge0 up
ifconfig bridge0 addm en0
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
//:
//: UserDefaultable.swift
//:
//: Created by Andyy Hope on 18/08/2016.
//: Twitter: @andyyhope
//: Medium: Andyy Hope, https://medium.com/@AndyyHope
import Foundation
// MARK: - Key Namespaceable
@klaaspieter
klaaspieter / ASS.md
Created June 22, 2017 07:59 — forked from anonymous/ASS.md
Acronyms Seriously Suck - Elon Musk

From time to time, Musk will send out an e-mail to the entire company to enforce a new policy or let them know about something that's bothering him. One of the more famous e-mails arrived in May 2010 with the subject line: Acronyms Seriously Suck:

There is a creeping tendency to use made up acronyms at SpaceX. Excessive use of made up acronyms is a significant impediment to communication and keeping communication good as we grow is incredibly important. Individually, a few acronyms here and there may not seem so bad, but if a thousand people are making these up, over time the result will be a huge glossary that we have to issue to new employees. No one can actually remember all these acronyms and people don't want to seem dumb in a meeting, so they just sit there in ignorance. This is particularly tough on new employees.

That needs to stop immediately or I will take drastic action - I have given enough warning over the years. Unless an acronym is approved by me, it should not enter the SpaceX glossary.

@zboralski
zboralski / vault-oidc-google-secrets.sh
Last active March 18, 2023 21:49
Write Google Cloud Platform (GCP) credentials to HashiCorp Vault
#!/bin/bash
# Write Google Cloud Platform (GCP) credentials to HashiCorp Vault
# https://gist.github.com/zboralski/709b2427bff863ab7868c6a1d2125591#file-vault-oidc-google-secrets-sh
# Then use vault-oidc-google-secrets.sh to configure OIDC
# https://gist.github.com/zboralski/8f44f9a3ece6cd01fbc675943b490a80#file-vault-oidc-google-config-sh
# Set project name and file names
PROJECT="example-vault-us"
@zboralski
zboralski / vault-oidc-google-config.sh
Last active March 19, 2023 20:58
Vault OIDC Google Provider Configuration
#!/bin/bash
# Configures Vault's OIDC authentication method to use Google as the provider.
# It retrieves the client ID and client secret from Vault, formats the GSuite service account
# JSON as required by Vault, and writes the configuration to Vault using the "gsuite" provider.
# This script assumes that Vault has already been initialized and unsealed, and that the OIDC
# authentication method has been enabled.
# Write first your Google Cloud Platform (GCP) credentials to HashiCorp Vault using