-
M-x eval-buffer
: Self-explanatory -
M-x replace-string
: Self-explanatory -
C-x C-c
: Quit emacs -
C-g
: Cancel current command (keyboard-quit)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.slug.gsub(/[ "'*@#$%^&()+=;:.,?>|\\<~_!]/,'-').gsub(/-{2,}/,'-') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Uid | |
extend ActiveSupport::Concern | |
included do | |
before_create :generate_uid | |
end | |
def to_param | |
self.uid | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to generate a secret key with Python | |
# via http://flask.pocoo.org/docs/quickstart/ | |
import os | |
os.urandom(24) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copyright 2014 Google Inc. All rights reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Log Search: last hour", | |
"services": { | |
"query": { | |
"list": { | |
"0": { | |
"query": "*", | |
"alias": "", | |
"color": "#7EB26D", | |
"id": 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: all setup pull push plan apply destroy | |
all: plan apply | |
setup: | |
terraform remote -backend=HTTP -address=$(TERRAFORM_BACKEND_ADDRESS)/merd.tfstate | |
pull: | |
terraform pull |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate public key file from secret key file | |
ssh-keygen -y -f ~/.ssh/key > ~/.ssh/key.pub | |
# Fetch the fingerprint for a host | |
# (Useful with salt ssh_kwown_host state) | |
ssh-keygen -l -f ~/.ssh/known_hosts -F github.com | |
# Show SSL Cert details | |
openssl x509 -in certificate.crt -text -noout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Simplified vimrc | |
" https://gist.github.com/kiasaki/6f27975306a45c169c79 | |
" ############################# | |
" PLUGINS | |
" ############################# | |
call plug#begin() | |
Plug 'airblade/vim-gitgutter' | |
Plug 'bling/vim-airline' | |
Plug 'edkolev/tmuxline.vim' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Statement": [ | |
{ | |
"Action": [ | |
"s3:ListAllMyBuckets" | |
], | |
"Effect": "Allow", | |
"Resource": [ | |
"arn:aws:s3:::*" | |
] |