Skip to content

Instantly share code, notes, and snippets.

Robin Mayfield rujmah

Block or report user

Report or block rujmah

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rujmah
rujmah / README.md
Last active Jan 25, 2019
AWS API Gateway that calls an single endpoint Lambda with GET
View README.md

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 / listFromJSON.js
Last active May 9, 2018
Trello: Quick list from JSON using Node
View listFromJSON.js
// 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}]`)
}
}
View ffprobe2json_demo.md
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 Feb 19, 2018
Rails RSpec set up (Rails 5.1.5)
View .railsrc
-d=postgresql
-T
--skip-coffee
@rujmah
rujmah / README.md
Last active Mar 8, 2018
Simple markdown note-taking bash script using Vim to Dropbox via command line
View README.md

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:

View gist:71fff9195c82750540e0d53b658da56b
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 Feb 21, 2017 — forked from willurd/web-servers.md
Big list of http static server one-liners
View web-servers.md

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 / centos_add_ports.md
Created Dec 9, 2016
add ports on Centos 7
View centos_add_ports.md

Review ports:

sudo semanage port -l | grep http_port_t

Add port:

sudo semanage port -a -t http_port_t  -p tcp 8024
@rujmah
rujmah / resize_centos.md
Created Dec 8, 2016
Resizing Centos 6 8GB root partition with Fdisk
View resize_centos.md

From this forum post:

Here are the steps i used to fix it.
Note that any mistake in recreating the partion will result in losing all data and/or the server will not reboot.
I would do this as the first step on a newly created instance.

I have marked the steps with <<#>> in the block below, so the are not a part of the command.
You need root permissions, so do a "sudo sh" if you are not root.
@rujmah
rujmah / express-multer-example-route.js
Created Jun 9, 2016
Express Multer Example Route
View express-multer-example-route.js
var multer = require('multer');
var fs = require('fs');
var copyFileSync = function (in, out) {
fs.createReadStream(in)
.pipe(fs.createWriteStream(out));
}
app.post('/upload', multer({dest: './uploaddir/'}).single('ffup'), function (req, res, next) {
console.log('body: '+ JSON.stringify(req.body));
You can’t perform that action at this time.