Skip to content

Instantly share code, notes, and snippets.

View kkirsche's full-sized avatar

Kevin Kirsche kkirsche

View GitHub Profile
@kkirsche
kkirsche / Install Composer to use MAMP's PHP.md
Last active January 30, 2024 02:30
How to install Composer globally using MAMP's PHP

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line:

@kkirsche
kkirsche / Create and Setup new Laravel 4 Project.md
Last active December 18, 2015 02:48
Create and Setup new Laravel 4 Project

Install Laravel 4

To install Laravel 4 we will take advantage of composer's create-project ability. We can do this in the following manner:

    composer create-project laravel/laravel LocalDirectoryName

This will install the Laravel project. Where I have put LocalDirectoryName, you can specify the folder name that you would like laravel installed to within the directory.

@kkirsche
kkirsche / AngularJS-List-Animation.markdown
Last active August 29, 2015 14:08
AngularJS List Animation Pen by Kevin Kirsche.

AngularJS List Animation

We are using ngAnimate / $animate service for AngularJS to slide a list item out from the above list item similar to list animations on the iPhone.

This AngularJS List Animation application is a Pen by R4z3r on CodePen.

License.

@kkirsche
kkirsche / open_ports
Created November 26, 2014 04:21
How to find open / listening ports on a linux machine
sudo netstat -ntlp | grep LISTEN
@kkirsche
kkirsche / _.md
Last active August 29, 2015 14:11
Reddit Bar Chart
@kkirsche
kkirsche / tmux.md
Last active August 29, 2015 14:11 — forked from andreyvit/tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@kkirsche
kkirsche / shell.md
Last active August 29, 2015 14:11
Shell Shortcuts

Shortcut — Action

  • CTRL + A — Move to the beginning of the line
  • CTRL + E — Move to the end of the line
  • CTRL + [left arrow] — Move one word backward (on some systems this is ALT + B)
  • CTRL + [right arrow] — Move one word forward (on some systems this is ALT + F)
  • CTRL + U (bash) — Clear the characters on the line before the current cursor position
  • CTRL + U (zsh) — If you're using the zsh, this will clear the entire line
  • CTRL + K — Clear the characters on the line after the current cursor position
  • ESC + [backspace] — Delete the word in front of the cursor
@kkirsche
kkirsche / countries.rb
Last active August 29, 2015 14:12
International Country Codes / State Abbreviations
# Use strings for un_num to avoid octal number interpretation
@countries = {
afghanistan: {
name: 'Afghanistan',
iso: 'AF',
un_a3: 'AFG',
un_num: '004',
dial: 93
},
albania: {
@kkirsche
kkirsche / authorize_me.sh
Last active August 29, 2015 14:19
Set local machine's public key as authorized on remote machine over SSH
cat ~/.ssh/id_rsa.pub | ssh root@10.211.55.9 'mkdir -p ~/.ssh/; touch ~/.ssh/authorized_keys; cat >> .ssh/authorized_keys'
@kkirsche
kkirsche / i_need_a_secure_string.py
Last active August 29, 2015 14:19
Secure String Generator
from base64 import b64encode;
from os import urandom;
from sys import argv;
def random_bytes(bytes):
random_bytes = urandom(bytes);
return b64encode(random_bytes).decode('utf-8');
if len(argv) > 1:
byte_value = int(argv[1])