Skip to content

Instantly share code, notes, and snippets.

View samdfonseca's full-sized avatar

Sam Fonseca samdfonseca

View GitHub Profile
apiVersion: v1
kind: Service
metadata:
name: wdb-server-service
labels:
run: wdb-server
spec:
selector:
run: wdb-server
type: ClusterIP
@samdfonseca
samdfonseca / intellij-codestyle.xml
Last active October 14, 2019 03:49
intellij-codestyle.xml
<code_scheme name="Sam Custom" version="173">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</value>
</option>
<option name="FORMATTER_TAGS_ENABLED" value="true" />
<HTMLCodeStyleSettings>
<option name="HTML_ALIGN_TEXT" value="true" />
@samdfonseca
samdfonseca / restart.sh
Created December 26, 2017 06:02
Ubuntu 16.04 WiFi Restarter
#!/bin/sh
LOGFILE=$(dirname $BASH_SOURCE)/restart-$(date +'%m-%d-%Y').log
echo_log() {
local msg=$1
echo "[$(date +'%m-%d-%Y %T')] - $msg" | tee -a $LOGFILE
}
@samdfonseca
samdfonseca / Taskfile.template
Last active November 13, 2016 08:19
This repository contains the default Taskfile template for getting started in your own projects. A Taskfile is a bash (or zsh etc.) script that follows a specific format. It's called Taskfile, sits in the root of your project and contains the tasks to build your project.
#!/usr/bin/env bash
# Quick start with the default Taskfile template
# alias run-init="curl -so Taskfile https://gist.githubusercontent.com/samdfonseca/022a8a21daf23ec1d7781812d9d91104/raw/d2f6dfaaf0a9e72852f7a3b31d22998b445ef0bb/Taskfile.template && chmod +x Taskfile"
# Run your tasks like: run <task>
# alias run=./Taskfile
PATH=./node_modules/.bin:$PATH
@samdfonseca
samdfonseca / README.md
Last active August 16, 2016 22:04
tpg-mock-api

tpg-mock-api is a mock server for the TPG DRVS API for testing specific scenarios. You specify the phase1 response data, and phase2 request data through the img field on the initial request. See success.jpg and error.jpg for examples.

@samdfonseca
samdfonseca / whitelist_ssl_certificate.sh
Last active October 18, 2016 16:19
Whitelist self-signed certs on OS X
#!/usr/bin/env bash -e
SERVERNAME=$(echo "$1" | sed -E -e 's/https?:\/\///' -e 's/\/.*//')
echo "$SERVERNAME"
if [[ "$SERVERNAME" =~ .*\..* ]]; then
echo "Adding certificate for $SERVERNAME"
echo -n | openssl s_client -connect $SERVERNAME:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | tee /tmp/$SERVERNAME.cert
sudo security add-trusted-cert -d -r trustRoot -k "$HOME/Library/Keychains/login.keychain" /tmp/$SERVERNAME.cert
else
samlenovoubuntu: /opt/internalhd/sam/dev/git/dingo-webui |master S:2 U:10 ?:6 ✗|
→ npm search pouchdb
<--- Last few GCs --->
43907 ms: Mark-sweep 829.0 (1202.6) -> 826.5 (1209.6) MB, 1524.8 / 0 ms (+ 386.1 ms in 667 steps since start of marking, biggest step 38.7 ms) [allocation failure] [GC in old space requested].
46080 ms: Mark-sweep 826.5 (1209.6) -> 800.6 (1191.6) MB, 2173.3 / 0 ms [allocation failure] [GC in old space requested].
49151 ms: Mark-sweep 800.6 (1191.6) -> 800.6 (1182.6) MB, 3070.8 / 0 ms [last resort gc].
52007 ms: Mark-sweep 800.6 (1182.6) -> 800.5 (1176.6) MB, 2855.7 / 0 ms [last resort gc].
let blacklists = [
\ "https://cloud.digitalocean.com/droplets/.*/console.*",
\ "https://tools.crowdtwist.com/issues/*",
\ "*://mail.google.com/mail/*
\ ]
function virtualenv_prompt_info {
if [ $VIRTUAL_ENV ]; then
echo "($(basename $VIRTUAL_ENV)) "
fi
}
PROMPT='%{$fg[blue]%}$(virtualenv_prompt_info)%{$fg[green]%}%~%{$fg_bold[blue]%}$(git_prompt_info)%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX="("
ZSH_THEME_GIT_PROMPT_SUFFIX=")"

Keybase proof

I hereby claim:

  • I am samdfonseca on github.
  • I am samdfonseca (https://keybase.io/samdfonseca) on keybase.
  • I have a public key ASA8ObV3rnt14hi6CJ5fZZFBqcpwjsrAdlkf51Uu2ZAIoQo

To claim this, I am signing this object: