link to notes https://git.io/vgpKc
- front-end web engineer
- funemployed, but joining Viki.com in a week
- recently spent 3 months in NYC at the Recurse Center
- retreat for programmers
- where people go to be better at what they do
<?php | |
/** | |
* A helper function expand_array for PHP | |
* | |
* This is actually developed during the real need to develop JSON api | |
* I wanted to have JSON api response spitted properly expanded (with semantic nodes) | |
* But didnot want to do it by playing with arrays (looping, merging n' what not) time and again. | |
* So, After fetching single dimensional array data from database, with keys having | |
* some specific delimeter, this helper would do for me what i want to. |
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
name: ingress-tutorial | |
annotations: | |
nginx.ingress.kubernetes.io/rewrite-target: / | |
spec: | |
backend: | |
serviceName: default-http-backend | |
servicePort: 80 |
#!/bin/bash | |
for f in *.mp4 | |
do | |
echo "Converting $f" | |
name=`echo "$f" | sed -e "s/.mp4$//g"` | |
ffmpeg -i "$f" -vn -acodec libmp3lame -ac 2 -ab 160k -ar 48000 "$name.mp3" | |
done |
link to notes https://git.io/vgpKc
Not for everyone. Each programmer has their own appreciation of what is good coding music.
(From most influential to least)
package main | |
import ( | |
"context" | |
"log" | |
"net/http" | |
"time" | |
"github.com/gin-gonic/gin" | |
) |
#!/bin/bash | |
# Get directory of script | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
if [[ $# -ne 1 ]] | |
then | |
echo "ERROR: This script expects the namespace name to be given as an argument" | |
echo "e.g. ./ecr-cred-updater.sh my-namespace" | |
exit 1 |
Note: There are better ways to do this by now. Check https://docs.docker.com/develop/develop-images/build_enhancements/#new-docker-build-secret-information for details
In order to access packages in private github repositories a Dockerfile might contain statements like this:
RUN git config --global url."https://${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
RUN npm install --ignore-scripts --quiet && npm cache clean --force
RUN git config --global --unset url."https://${GITHUB_TOKEN}@github.com/".insteadOf
########## Install NGINX ############## | |
# Install software-properties-common package to give us add-apt-repository package | |
sudo apt-get install -y software-properties-common | |
# Install latest nginx version from community maintained ppa | |
sudo add-apt-repository ppa:nginx/stable | |
# Update packages after adding ppa |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Index</title> | |
<script type="text/javascript"> | |
window.open ("popup.html","mywindow", "width=350,height=250"); | |
// Create IE + others compatible event handler |