Skip to content

Instantly share code, notes, and snippets.

@jimangel
jimangel / readme.md
Last active April 17, 2021 14:47
Examples of how to test the impact of the v1.16 API deprecations

Kubernetes v1.16 API deprecation testing

Examples of how to test the impact of the v1.16 API deprecations and ways to debug early!

If this is the first time you're hearing of these deprecations STOP and read this blog post (thanks @vllry!).

Common misunderstandings

  1. The exact apiVersion: value that I use in my manifest is stored on disk (etcd).

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@hunterloftis
hunterloftis / gist:1e42a29491330f89ae36
Created August 24, 2015 18:06
problems with CLI buildpacks array manipulation
  1. The add/set commands are ambiguous and confusing
  2. Forking/cloning requires a sometimes-long sequence of tedious add/set/clear commands
  3. The list of buildpacks isn't carried with the files in a repo

what does buildpacks:set do?

Can you set the whole list at once, eg heroku buildpacks:set url1, url2, url3? Or does it only set the final buildpack? If you have a previously defined list, what does :set do? Does it replace the final buildpack, or blow away the whole list, or error?

@cobyism
cobyism / osx-install-media.md
Last active March 11, 2023 00:42
Command to create installable OS X USB drive.

Creating a bootable macOS USB installer

  • First, plug in an 8GB (or bigger) USB drive, and use Disk Utility to erase it
  • If you use the default settings, you should wind up with a blank drive at /Volumes/Untitled.

With that volume in place, and with the macOS installer sitting in /Applications/Install\ macOS\ [VERSION].app, run the following command in your terminal to create a bootable install media (for Sierra):

sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ macOS\ Sierra.app --nointeraction
@qmx
qmx / HelloJite.java
Created September 23, 2013 18:21
Jitescript with macros
package me.qmx.jipsy;
import me.qmx.jitescript.CodeBlock;
import me.qmx.jitescript.JiteClass;
import java.io.PrintStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@nicksieger
nicksieger / jruby.sh
Created March 15, 2012 16:20
JRuby launcher script to use in Warbler war files
#!/bin/sh
#
# Simple script to launch JRuby using the components embedded in a war created by Warbler.
# Tell Warbler to put this script in /WEB-INF with this config/warble.rb code:
#
# config.webinf_files += FileList["jruby.sh"]
#
HERE=`dirname $0`
GEM_HOME=$HERE/gems
@jcrossley3
jcrossley3 / todo.org
Created January 24, 2012 16:55
Simulated clustering

To test clustering using a single JBoss instance on a single server, use the properties jboss.node.name, jboss.server.data.dir, and jboss.socket.binding.port-offset

In one shell, run

$JBOSS_HOME/bin/standalone.sh --server-config=standalone-ha.xml -Djboss.node.name=one -Djboss.server.data.dir=/tmp/one

In another, run

$JBOSS_HOME/bin/standalone.sh --server-config=standalone-ha.xml -Djboss.node.name=two -Djboss.server.data.dir=/tmp/two -Djboss.socket.binding.port-offset=100
@johnthethird
johnthethird / server.log
Created December 3, 2011 03:37
Torquebox error: (LoadError) library `fcntl' could not be loaded: java.lang.NullPointerException
## SOLUTION
I was able to get past the error by putting this line at the top of config/application.rb
require 'fcntl'
##
torquebox-2.0.0.beta1
$ uname -a
Darwin JohnsAir.local 11.2.0 Darwin Kernel Version 11.2.0: Tue Aug 9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 x86_64
@exoer
exoer / db_server.rb
Created July 4, 2011 17:58 — forked from coderanger/db_server.rb
Create postgres users and databases from Chef
include_recipe "postgresql::server90"
# inspiration from
# https://gist.github.com/637579
execute "create-root-user" do
code = <<-EOH
psql -U postgres -c "select * from pg_user where usename='root'" | grep -c root
EOH
command "createuser -U postgres -s root"
#!/bin/sh
# simple script for turning a jar with a Main-Class
# into a stand alone executable
# cat [your jar file] >> [this file]
# then chmod +x [this file]
# you can now exec [this file]
commandToRun="$(printf "%q " "$@")"
if test "$commandToRun" = "'' "; then
eval "exec java -Xmx1G -jar $0"
else