Skip to content

Instantly share code, notes, and snippets.

View carlosa8c's full-sized avatar

Carlos Cabrera carlosa8c

  • Tumblr/Automatic
  • Florida
View GitHub Profile
@carlosa8c
carlosa8c / dep.md
Created November 28, 2018 19:03 — forked from subfuzion/dep.md
Concise guide to golang/dep

Overview

This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.

I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/ in my Dockerfiles, and also work from isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/.

At the end of the day, vendoring (and committing vendor/) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:

@carlosa8c
carlosa8c / listener.py
Created October 15, 2018 03:43 — forked from EnumCode/listener.py
listener that triggers the main program
import threading
import pyazo
import keyboard
wxTest.main()
lock=threading.Lock()
while True:
keyboard.wait('ctrl+shift+d')
lock.acquire()
pyazo.main()
lock.release()
@carlosa8c
carlosa8c / pyazo.py
Created October 15, 2018 03:43 — forked from EnumCode/pyazo.py
pyazo client side
import wx
import pyautogui
import requests
import webbrowser
class MyApp(wx.App):
def __init__(self, parent=None):
wx.App.__init__(self, False)
self.frame = MyFrame(parent, -1, passBack=self)
@carlosa8c
carlosa8c / server.py
Created October 15, 2018 03:43 — forked from EnumCode/server.py
pyazo server side
from flask import Flask, request, redirect, url_for
import os
import random
import string
UPLOAD_FOLDER = '/var/www/html/uploads'
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif'])
@carlosa8c
carlosa8c / default.txt
Created October 15, 2018 03:43 — forked from EnumCode/default.txt
nginx config file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@carlosa8c
carlosa8c / Jenkinsfile.groovy
Created June 13, 2018 23:46 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER'
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"'
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"'
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"'
echo 'Using three backslashes still results in preserving the single quotes'
@carlosa8c
carlosa8c / list-old-hdfs-files.sh
Created October 10, 2017 15:43 — forked from ace-subido/list-old-hdfs-files.sh
Script to list/delete old files in an HDFS Directory
#!/bin/bash
usage="Usage: ./list-old-hdfs-files.sh [path] [days]"
if [ ! "$1" ]
then
echo $usage;
exit 1;
fi
if [ ! "$2" ]
#!/bin/bash
if [ -z "$1" ]; then
readonly test_mode=false
else
echo "Running TEST mode. No destructive changes"
readonly test_mode=true
fi
JQPATH=$(which jq)
#!/bin/bash
set -e
# Those should be JENKINS vars
NAME=nginx-deployment-3
PODS_COUNT=3
CONTAINER_NAME=nginx
DOCKER_IMAGE='nginx:1.8'
# Template can be copied from deploy.tmp.yaml to update jenkins var