Skip to content

Instantly share code, notes, and snippets.

@drjova
drjova / bash_prompt.sh
Last active December 30, 2015 08:29 — forked from insin/bash_prompt.sh
# The various escape codes that we can use to color our prompt.
RED="\[\033[0;31m\]"
YELLOW="\[\033[1;33m\]"
GREEN="\[\033[0;32m\]"
GREENBOLD="\[\033[1;32m\]"
BLUE="\[\033[1;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
@drjova
drjova / Youtube categories
Created December 18, 2013 17:32
Get youtube categories
https://www.googleapis.com/youtube/v3/videoCategories?part=snippet&regionCode=US
@drjova
drjova / My IP
Created February 27, 2014 22:15
Return my IP
function my_ip() # Get IP adress on ethernet.
{
MY_IP=$(/sbin/ifconfig en0 | awk '/inet/ { print $2 } ' |
sed -e s/addr://)
echo ${MY_IP:-"Not connected"}
}

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@drjova
drjova / The Technical Interview Cheat Sheet.md
Last active September 9, 2015 16:31 — forked from seanlane/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on a sequential index, most commonly 0 based.
  • Based on tuples from set theory.
@drjova
drjova / patch.rb
Last active October 8, 2015 14:47
Fix mac external screen colors and blurry icons
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@drjova
drjova / config.py
Last active August 26, 2016 13:52
Flask-IIIF custom cache example
# In your overlay's configuration (/s/overlay/YOUR_OVERLAY)
IIIF_CACHE_HANDLER = 'overlay.utils:FileSystemCache'
@drjova
drjova / README.md
Last active October 21, 2015 13:19
Create bootable OSX

Connect to your Mac a properly formatted 8GB (or larger) drive, and rename the drive Untitled. (The Terminal commands I provide here assume that the drive is named Untitled. If the drive isn’t named Untitled, the procedure won’t work.) Make sure the El Capitan installer (or at least a copy of it), called Install OS X El Capitan.app, is in its default location in your main Applications folder (/Applications). Select the text of the following Terminal command and copy it. sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app --nointeraction Launch Terminal (in /Applications/Utilities). Warning: This step will erase the destination drive or partition, so make sure that it doesn’t contain any valuable data. Paste the copied command into Terminal and press Return. Type your admin-level account password when prompted, and then press Return. You may see the message “To continue we need to era

@drjova
drjova / README.md
Created December 15, 2015 08:14 — forked from chriswessels/README.md
A guide to setting up self-hosted infrastructure for Meteor applications on Ubuntu Server 13.04.

#Meteor and Self-hosted Infrastructure

Meteor is an eye-opening JavaScript framework that runs on both the client and the server, giving developers a revolutionary take on software engineering. If you are not familiar with Meteor, I urge you to visit their website.

##An overview

In this brief gist, I am going to discuss the process of setting up a server (in my case, a VPS) to host Meteor applications.

My experience with Meteor has been brief, however it has not taken much demonstration for me to realise the significance of this stellar framework. Let's jump right in!