Skip to content

Instantly share code, notes, and snippets.

@thoop
thoop / .htaccess
Last active November 13, 2024 20:20
Official prerender.io .htaccess for Apache.
# Change YOUR_TOKEN to your prerender token
# Change http://example.com (at the end of the last RewriteRule) to your website url
<IfModule mod_headers.c>
RequestHeader set X-Prerender-Token "YOUR_TOKEN"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
@douglascorrea
douglascorrea / install-nodejs-amazon-ec2-centos
Last active July 7, 2019 09:46
Install NodeJS on Amazon Linux EC2 (CentOS)
sudo yum install openssl openssl-devel
sudo yum groupinstall "Development Tools"
sudo yum install git-core
git clone [email protected]:nodejs/node.git
cd node
./configure
make
@christianalfoni
christianalfoni / app.js
Last active October 5, 2017 22:48
Angular JS state services for scalable applications
angular.module('app', [])
// We define a service state
.service('AppState', function ($rootScope) {
// We define a namespace for our application state and
// make it available as a variable for conveniance
var app = $rootScope.app = {};
// We define an application state

Javascript Shorthand Coding Techniques

My (@pongstr) opinion about shorthand coding techniques

Shorthand code is not really a replacement for normal coding but it is very handy and useful in some cases. There are tons of opinions and debates around this but, again it all comes down what is necessary for your codebase and using it responsibly.

@stephenway
stephenway / README.md
Last active June 22, 2024 16:04
BEMIT Cheatsheet
@pongstr
pongstr / bash.md
Last active September 26, 2022 11:44
Bash useful commands :D

dirs

# display the directory stack vertically, prefixing each
# entry with its index in the stack.
$ dirs -v

# cd and push the path to the directory stack.
$ pushd /path/to/directory
@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active July 17, 2025 09:01
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation