Skip to content

Instantly share code, notes, and snippets.

View rujmah's full-sized avatar
👨‍🚀
Looking to the future

Robin Mayfield rujmah

👨‍🚀
Looking to the future
View GitHub Profile
@rujmah
rujmah / README.md
Last active January 25, 2019 09:16
AWS API Gateway that calls an single endpoint Lambda with GET

AWS API Gateway that calls an single endpoint Lambda with GET

Pertinent info

Ensure IntegrationHttpMethod is set to POST even if you want to use a GET (or whatever)

e.g.

  rootMethod:
 Type: AWS::ApiGateway::Method
@rujmah
rujmah / default_rails_template.rb
Last active October 31, 2018 19:33
Generally, default rails template using mongoid, rspec and cucumber.
generators = []
puts 'Spinning up a new app, captain!'
run 'rm public/index.html'
run 'rm public/images/rails.png'
run 'rm README'
run 'touch README'
gsub_file 'public/robots.txt', /# User-Agent/, 'User-Agent'
gsub_file 'public/robots.txt', /# Disallow/, 'Disallow'
@rujmah
rujmah / listFromJSON.js
Last active May 9, 2018 16:22
Trello: Quick list from JSON using Node
// export json from trello board
const board = require('./path/to/trelloboard.json')
for(let list of board.lists){
let listcards = board.cards.filter(c => c.idList === list.id )
console.log(list.name)
for(let card of listcards){
console.log(`\t${card.name} [${card.desc}]`)
}
}
@rujmah
rujmah / README.md
Last active March 8, 2018 09:16
Simple markdown note-taking bash script using Vim to Dropbox via command line

Simple Note-taking from command line

What it does:

  • Notes will appear in with ISO date prefix in directory
  • Running the command multiple times a day will re-open that days notes
  • Assumes you have a Dropbox account (or some directory) at the path below
  • Tested on Ubuntu 16.04 and 17.10

Implementation:

@rujmah
rujmah / ffprobe2json_demo.md
Last active February 19, 2018 20:37
ffprobe to json
ffprobe -v quiet -show_format -show_streams -pretty -print_format json ./video_file.mp4

Will output some lovely JSON to the console. Dump to a file with > json_file.json or what-have-you.

@rujmah
rujmah / .railsrc
Created February 19, 2018 20:32
Rails RSpec set up (Rails 5.1.5)
-d=postgresql
-T
--skip-coffee
provider "heroku" {
email = "test@example.com"
api_key = "call heroku auth:token"
}
resource "heroku_app" "default" {
name = "herokutest"
region = "us"
config_vars {
@rujmah
rujmah / web-servers.md
Created February 21, 2017 17:35 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@rujmah
rujmah / docker_cheatsheet.md
Last active December 15, 2016 18:03
docker cheatsheet

Remove all non running containers: docker rm $(docker ps -a -f="status=exited" -q) see also Docker filtering

Remove unused images docker rmi $(docker images --filter "dangling=true" -q --no-trunc) (but check link for more)

Get list IP of all running containers docker inspect -f '{{.Name}} - {{.NetworkSettings.IPAddress }}' $(docker ps -aq) (StackOverflow answer)

One liner to stop / remove all of Docker containers:

@rujmah
rujmah / centos_add_ports.md
Created December 9, 2016 18:15
add ports on Centos 7

Review ports:

sudo semanage port -l | grep http_port_t

Add port:

sudo semanage port -a -t http_port_t -p tcp 8024