Skip to content

Instantly share code, notes, and snippets.

apiVersion: batch/v1beta1
kind: CronJob
metadata:
annotations:
name: ecr-cred-helper
namespace: default
spec:
concurrencyPolicy: Allow
failedJobsHistoryLimit: 1
jobTemplate:
@rgaidot
rgaidot / the-basics-of-JavaScript-with-arrays.js
Created July 17, 2018 18:56
The basics of JavaScript with Arrays
// Code Challenge #11: JavaScript Functional Programming
// https://scotch.io/bar-talk/code-challenge-11-javascript-functional-programming
// ARRAY 1
const texasss = [{
name: 'Mike',
age: 23,
gender: 'm',
us: false,
@rgaidot
rgaidot / gist:72e34ca92f62382e7b9c18afc06b5762
Created June 16, 2017 08:24 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@rgaidot
rgaidot / compose-install.service
Created January 28, 2017 13:11
Docker Compose on CoreOS
[Unit]
Description=Docker Compose on CoreOS
After=docker.service
Requires=docker.service
[Service]
Type=oneshot
RemainAfterExit=yes
TimeoutStartSec=0

There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.

All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.

  1. Loop variables are scoped outside the loop.

What do these lines do? Make predictions and then scroll down.

func print(pi *int) { fmt.Println(*pi) }
@rgaidot
rgaidot / gitflow-breakdown.md
Created September 12, 2016 16:24 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository

@rgaidot
rgaidot / post-merge
Created May 25, 2016 20:22 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed. In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed. Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@rgaidot
rgaidot / build_rancheros_for_rpi.sh
Created May 24, 2016 08:52
Build RancherOS for Raspberry Pi
#!/bin/zsh
git clone https://github.com/rancher/os.git
cd os/scripts/images/rpi-hypriot
docker build -f Dockerfile.dapper --pull -t rancheros/rpi .
docker run -ti --privileged -v `pwd`/scripts/build.sh:/source/scripts/build.sh -v `pwd`/dist:/source/dist rancheros/rpi
echo ---
echo Done!
echo Now you can unzip rancheros-rpi2.zip in os/scripts/images/rpi-hypriot/dist
@rgaidot
rgaidot / opparis-skynet-isis
Created November 17, 2015 22:16
#SKYNET #OpParis #ISIS
#SKYNET
--// USAGE //-----------------------------------------------------------------------
HELP EXPOSE ISIS SITES
Paste the arabic strings into a middle-eastern based search engine
Or use it in combination with the python script to generate new search
strings.
@rgaidot
rgaidot / raspbian_server_cleaning.sh
Last active May 24, 2016 08:53
Make a raspbian server without X11 and other packages
#!/bin/zsh
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep x11 | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep python | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep sound | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep gnome | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep lxde | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep gtk | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep desktop | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep gstreamer | sed s/install//`
sudo apt-get -y remove `sudo dpkg --get-selections | grep -v "deinstall" | grep avahi | sed s/install//`