Skip to content

Instantly share code, notes, and snippets.

View Modulus's full-sized avatar
:octocat:

John Sigvald Skauge Modulus

:octocat:
View GitHub Profile
{
"public_identifier": "eden-marco",
"profile_pic_url": "https://img-c.udemycdn.com/user/200_H/30508036_0f4a_4.jpg",
"background_cover_image_url": null,
"first_name": "Eden",
"last_name": "Marco",
"full_name": "Eden Marco",
"follower_count": null,
"occupation": "Customer Engineer at Google",
"headline": "Customer Engineer @ Google Cloud | Best-selling Udemy Instructor",
@Modulus
Modulus / lifetime.rs
Last active May 5, 2021 13:31
Rust lifetime
use std::fmt;
//#[derive(Debug)]
struct What<'a> {
x: &'a str,
y: &'a str,
}
impl <'a> fmt::Display for What<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@Modulus
Modulus / kubernetes_add_service_account_kubeconfig.sh
Last active June 10, 2018 19:30 — forked from innovia/kubernetes_add_service_account_kubeconfig.sh
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
#set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@Modulus
Modulus / install_oracle_8.yml
Created February 15, 2017 10:38
Ansible task to install oracle jdk on ubuntu
---
- name: Install add-apt-repostory
apt: name=software-properties-common state=latest
- name: Add Oracle Java Repository
apt_repository: repo='ppa:webupd8team/java'
- name: Select button oracle licence
command: bash -c "echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections"
@Modulus
Modulus / Tail.scala
Last active August 29, 2015 14:01
Tail recursive Scala
/**
* Paste this into a scala worksheet
*/
//First of some scala functions on Lists.
val nums = List(2, -4, 5, 7, 1)
val fruits = List("apple", "pineapple", "orange", "banana", "lime", "lemon")
nums filter (x => x > 0)
nums filterNot (x => x > 0)
class MyFirstGist(object):
def doGist(self):
print("This is my first Gist")