Skip to content

Instantly share code, notes, and snippets.

View zazk's full-sized avatar
:octocat:
Let's talk about Javascript & DevOps

Enrique Juan de Dios zazk

:octocat:
Let's talk about Javascript & DevOps
View GitHub Profile
@zazk
zazk / protoc-gen-go.sh
Created March 24, 2020 18:02 — forked from f3nry/protoc-gen-go.sh
Generating proto Go code from a definition
brew install protobuf
go get -u google.golang.org/grpc
go get -u github.com/golang/protobuf/protoc-gen-go
protoc -I=./api --go_out=plugins=grpc:./api ./api/hello.proto
@zazk
zazk / README.md
Last active August 6, 2020 11:47
Mac OS Developer Setup
@zazk
zazk / Dockerfile
Created September 1, 2019 21:23 — forked from erdostom/Dockerfile
Good starter Dockerfile + docker-compose.yml for Rails 6.
FROM ruby:2.6.3-alpine
RUN apk add --update --no-cache bash build-base nodejs sqlite-dev tzdata postgresql-dev yarn
RUN gem install bundler:2
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn install --check-files
func onMainDo<T>(_ firstMainBlock: @escaping () -> Void, onBackgroundDo backgroundBlock: @escaping () -> T, thenOnMainDo mainBlock: @escaping (T) -> Void) {
DispatchQueue.main.async {
firstMainBlock()
DispatchQueue.global(qos: .background).async {
let result = backgroundBlock()
DispatchQueue.main.async {
mainBlock(result)
}
}
}
func startApp() {
onMainDo({
self.activityIndicator.startAnimating()
}, onBackgroundDo: {
let storage = PersistentSecureStorage.shared()
guard let savedToken == storage.token {
return .goToAuth
}
let tokenIsValid = authService.isValidToken(savedToken)
if !tokenIsValid {
@zazk
zazk / CodeChallenge.md
Last active August 17, 2019 03:34
Challenge Android

Your assignment is to create a simple Reddit client that shows the top 50 entries from Reddit - www.reddit.com/top Guidelines:

  • Assume latest Android platform
  • Support Landscape What to show The app should be able to show data from each entry such as:
  • Title (at its full length, so take this into account when sizing your cells)
  • Author
  • entry date, following a format like “x hours ago”
  • A thumbnail for those who have a picture.
@zazk
zazk / .tmux.conf
Created April 22, 2019 12:45 — forked from subfuzion/.tmux.conf
My .tmux.conf for tmux 2.1 (with fixes for mouse breakage)
# Inspirations:
# http://mutelight.org/practical-tmux
# http://zanshin.net/2013/09/05/my-tmux-configuration/
# http://files.floriancrouzat.net/dotfiles/.tmux.conf
# http://stackoverflow.com/questions/9628435/tmux-status-bar-configuration
# https://github.com/Lokaltog/powerline
# https://github.com/remiprev/teamocil
# http://superuser.com/questions/74492/whats-the-best-prefix-escape-sequence-for-screen-or-tmux
# http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/
#
@zazk
zazk / get.dni.sh
Last active February 23, 2019 03:55
SUNAT RUC
curl -XGET http://aplicaciones007.jne.gob.pe/srop_publico/Consulta/Afiliado/GetNombresCiudadano?DNI=40392025
@zazk
zazk / flatter.js
Created February 7, 2019 14:20
Flat composed array to a flat one
function flatter( arr ){
return arr.reduce(function (result, el) {
return result.concat(Array.isArray(el) ? flatter(el) : el);
}, []);
}
@zazk
zazk / bitbucket-pipelines.yml
Last active February 7, 2019 12:14 — forked from kainiklas/bitbucket-pipelines.yml
Bitbucket Pipeline for Angular 6 + Firebase deployment
image: node:10
pipelines:
branches:
master:
- step:
name: "Build, test and deploy to firebase production"
deployment: production
caches:
- node