Skip to content

Instantly share code, notes, and snippets.

View btamayo's full-sized avatar
🏠
Working from home

Bianca Tamayo btamayo

🏠
Working from home
View GitHub Profile
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
#

agnoster-with-rvm.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@btamayo
btamayo / 0_reuse_code.js
Last active August 29, 2015 14:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@btamayo
btamayo / gist:d8cc7447fce217fabc00
Created October 6, 2015 05:21
Shortest substring
public String scanString() {
int start = s.length() - 1;
int end = s.length() - 1;
int maxLengthFound = s.length(); // Initial maximum length
System.out.println("end: " + end);
for (int i = 0; i < s.length(); i++) {
System.out.println("Checking substring: " + s.substring(0, i + 1) + ", valid: " + isValid());

Keybase proof

I hereby claim:

  • I am btamayo on github.
  • I am btamayo (https://keybase.io/btamayo) on keybase.
  • I have a public key whose fingerprint is 293E AEBD 6EC3 21C6 B403 5351 FB06 F9A0 579F 1956

To claim this, I am signing this object:

@btamayo
btamayo / fmtstr.py
Last active August 25, 2017 01:46
Format string problem
# Template
TEST_TEMPLATE_RAW = """@test "{description} [{shell}]" {{
run ./{script_name} {shell} --debug --no-exec
{assert_type} {partial} {regexflag} "{expected}"
}}
# Codebit
# test is dumped in by pyyaml
print TEST_TEMPLATE_RAW.format(**test)
@btamayo
btamayo / brew-java-and-jenv.md
Created March 8, 2018 19:24 — forked from tomysmile/brew-java-and-jenv.md
How To Install Java 8 on Mac

Install HomeBrew first

brew update
brew tap caskroom/cask
brew install brew-cask

If you get the error "already installed", follow the instructions to unlink it, then install again:

@btamayo
btamayo / ocr-shot.sh
Last active March 20, 2018 16:07 — forked from pnc/ocr-shot.sh
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@btamayo
btamayo / nginx.conf
Created March 25, 2018 19:40 — forked from kmjones1979/nginx.conf
Example NGINX configuration to route based on country code using GeoIP
# load dynamic modules
load_module /etc/nginx/modules/ngx_http_geoip_module.so;
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events { worker_connections 1024; }
http {
@btamayo
btamayo / del_cluster.sh
Last active June 13, 2024 02:53 — forked from ianchen06/del_cluster.sh
delete proxmox cluster
# source: https://forum.proxmox.com/threads/removing-deleting-a-created-cluster.18887/
#/bin/sh
# stop service
systemctl stop pvestatd.service
systemctl stop pvedaemon.service
systemctl stop pve-cluster.service
systemctl stop corosync
systemctl stop pve-cluster
killall pmxcfs