Skip to content

Instantly share code, notes, and snippets.

Commands I use but don't always remember:

nvm alias default <branch_number>: makes it so you don't have to repeatedly set the node version

git push --force-with-lease: doesn't overwrite anything the way git push -f does

git rebase -i HEAD~30 : allows you to modify your last 30 commits (squash, delete, edit, etc) one at a time

git pull -r origin master (same as git pull --rebase origin master) : rebases your current branch on the specified branch at the same time as pulling the current state of the specified branch

git merge --ff-only origin merges only if applying the changes on top won't cause any conflicts. Run from on the branch you want to merge to.

kdv24 /
Created March 7, 2016 00:56
mac shortcuts

Command Tab- switch between apps

Command Arrow or Control Tab- switch tabs of current window

Control Arrow- switch desktops

kdv24 /
Last active March 7, 2016 00:52
simple sinatra setup

File structure:

  • Project Folder
    • Gemfile
kdv24 /
Created February 29, 2016 22:09
Unix tips

from Learning Unix for OSX

Chapter One:

TTY- tells you the terminal the process is running in, 'd' stands for daemon, an always-running system level task

grep- basically a Unix search tool for finding words or output of a command eg ps -ax | grep Word

to display all Unix programs/commands (binary executables) hold down Shift/Esc/?

#Null Object - provides a ‘do nothing’ implementation (aka, Stub, Active Nothing, Active Null, special case of: Singleton, Strategy, Command, State Patterns)

##purpose: • avoid special if blocks for do nothing code • puts do nothing code in NullObject to be responsible for it • removes client awareness of whether object is real or null • rid program logic of null checks where possible • provide a non-functional object in place of a null reference

Hosting on Google Drive
Google Drive Logo
Google Drive may also be used as hosting service. The disadvantage is that you will get a very long URL. Here is how it works.
Upload your website folder to Google Drive.
Select the folder on Drive and choose Share. Click on Advanced and change the access to Public on the web.
Open the folder in Drive and verify that all website files have been uploaded (index.html, images, etc.).
kdv24 / React-Native
Last active November 22, 2015 19:26
React Native starter info
kdv24 / .bash_profile
Created October 23, 2015 00:19 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
# Description: This file holds all my BASH configurations and aliases
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management

#React Much of the contents have been lifted pretty much word for word from other sources and just aggregated here. I have cited the originial for some, but a lot of citing still needs to happen.

##Table of Contents

  1. Introduction
  2. Setup
  3. [Resources] (#resources)
  4. Components
  5. States & Properties
kdv24 /
Last active August 29, 2015 14:26 — forked from jfloff/
How to get MAMP to work with SSL ... Yes really.

First of all you need to be able to run MAMP in port 80. This is a "heat check" if you don't have any process jamming http ports. You can check it like this:

sudo lsof | grep LISTEN

If you do happen to have any process with something like this *:http (LISTEN), you are in trouble. Before with adventure check if it isn't MAMP itself (yeah, you should close that beforehand)

ps <pid of that process>

If you don't see MAMP, you are in good hands, I have just the thing for you: