Skip to content

Instantly share code, notes, and snippets.

View zoidyzoidzoid's full-sized avatar
🌈
Be the change you wanna see in the world!

Zoid zoidyzoidzoid

🌈
Be the change you wanna see in the world!
View GitHub Profile
#!/usr/bin/env bash
#
# Bash script for checking what installed packages in a virtualenv needs updates
#
# Requires:
# - OSX
# - core-utils installed (brew install core-utils)
# - pypi-cli installed (pip install pypi-cli)
#
# Example output:
@zoidyzoidzoid
zoidyzoidzoid / kubernetes-service.yml
Created April 6, 2017 14:26
kubectl get svc/kubernetes -o yaml --export
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
component: apiserver
provider: kubernetes
name: kubernetes
selfLink: /api/v1/namespaces//services/kubernetes
spec:

Question

Guys, I’m far from a regex expert. Where should I start if I want to convert my file with text like This is a text to <span id="f001">This</span><span id="f002"> is</span><span id="f003"> a</span><span id="f004"> text</span>

Solution

@zoidyzoidzoid
zoidyzoidzoid / open-space-build-servers.md
Last active November 9, 2016 06:52
Cape Town DevOps Days Open Space Notes #DevOpsDaysCPT

Build Servers

Jenkins

  • Jenkins Job Builder
  • Pipeline Plugin
  • Autoscaling agents/executors

Hosted CI

  • Travis CI
  • CircleCI
#!/usr/bin/env bash
#
# Print out commands for uninstalling old Python 2.7, PyPy, 3.x versions,
# and installing the latest versions.
#
# Currently does 2.7, PyPy, 3.3, 3.4, 3.5, and 3.6.
# pyenv uninstall -f 2.7.13
# pyenv uninstall -f 3.3.6
# pyenv uninstall -f 3.4.6
# pyenv uninstall -f 3.5.3
@zoidyzoidzoid
zoidyzoidzoid / lfs-enable
Last active July 5, 2016 06:51
Notes on Git
#!/bin/bash
#
# Remove all files with a certain extension and add them to git-lfs
#
# Install git-lfs on OSX with `brew install git-lfs`
set -eu
set -o pipefail
EXT=$1
@zoidyzoidzoid
zoidyzoidzoid / Notes.md
Last active April 25, 2016 15:03
Example reusable Google Cloud Platform gcloud configuration

gcloud config configurations was added to gcloud CLI in version 0.9.79 (2015/09/23)

(You probably don't need the [app] section)

@zoidyzoidzoid
zoidyzoidzoid / update-requirements.bash
Created April 13, 2016 08:56
Script for updating requirements.txt using Kenneth Reitz's new better pip workflow: http://www.kennethreitz.org/essays/a-better-pip-workflow
#!/bin/bash
set -efxu
cd "$(dirname "$0")/.."
if [ ! -f requirements-to-freeze.txt ]; then
echo "No requirements to freeze file found!"
exit 1
fi
"""
DJANGO
"""
from django.http import JsonResponse
def simple(request):
return JsonResponse({'health': 'OK'})
#!/usr/bin/env python
import matplotlib.pyplot as plt
import math
import random
data = [random.randint(10,100) for i in range(0,100)]
class Analysis(object):