Skip to content

Instantly share code, notes, and snippets.

View ayushya's full-sized avatar

Ayushya Jaiswal ayushya

View GitHub Profile
@indradhanush
indradhanush / rotate-aws-iam-keys.sh
Last active October 16, 2019 08:43
AWS Access Key rotation
#!/bin/bash
#
# This script rotates your aws access keys by creating
# a new one and deleting the older one.
# Requirements
# You must have a working aws cli configured already
# Run `aws configure` otherwise first before running this script.
# Installation & Usage
@branneman
branneman / better-nodejs-require-paths.md
Last active April 8, 2024 00:22
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@bluefuton
bluefuton / gist:1468061
Created December 12, 2011 16:15
OS X: replace tabs with spaces in all files using expand
find . -name "*.php" | while read line; do expand -t 4 $line > $line.new; mv $line.new $line; done
@lancejpollard
lancejpollard / node-folder-structure-options.md
Created November 28, 2011 01:50
What is your folder-structure preference for a large-scale Node.js project?

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin