Skip to content

Instantly share code, notes, and snippets.

@joshuaob
joshuaob / exampleShippingMethodScript.js
Last active November 26, 2015 12:04
example script to calculate shipping methods based on cartTotal
// example script to calculate shipping methods based on cartTotal
// cartTotal variable must be a number and present for a dry run
// returns and array of shipping method objects
// adds a free shipping method if cart total is above 50
function ShippingMethod(label, reference, cartTotal, basePrice){
this.label = label;
this.price = calculatePrice(cartTotal, basePrice);
this.tax = 0.1 * this.price;
this.description = this.label + " shipping method";
@stevebowman
stevebowman / AWSLambdaSimpleSMS.js
Last active April 17, 2025 16:26
AWS Lambda Function to send an SMS message via the Twilio API
console.log('Loading event');
// Twilio Credentials
var accountSid = '';
var authToken = '';
var fromNumber = '';
var https = require('https');
var queryString = require('querystring');
@ChuckJHardy
ChuckJHardy / digital_ocean_setup.md
Last active September 17, 2025 05:34
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions

DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3

SSH into Root

$ ssh root@123.123.123.123

Change Root Password

@kennethkalmer
kennethkalmer / nginx.conf
Last active August 3, 2021 19:44
Sample nginx config for serving a rails API and static frontend like Ember on the same domain...
daemon off;
worker_processes 4;
events {
use epoll;
accept_mutex on;
multi_accept on;
worker_connections 1024;
}
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active November 5, 2025 13:48
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@jaicab
jaicab / responsive-video.css
Last active December 11, 2024 20:06
Pure CSS solution for embed videos with an aspect ratio of 16:9
.video-container {
position: relative;
padding-bottom: 56.25%; /*16:9*/
padding-top: 30px;
height: 0;
overflow: hidden;
}
.video-container iframe,
.video-container object,
@vjt
vjt / awesome-nginx.conf
Created January 31, 2011 19:43
*AWESOME* nginx configuration for Ruby/Rack web applications
#
# mmm m m mmm mmm mmm mmmmm mmm
# " # "m m m" #" # # " #" "# # # # #" #
# m"""# #m#m# #"""" """m # # # # # #""""
# "mm"# # # "#mm" "mmm" "#m#" # # # "#mm"
#
# nginx configuration For Ruby/Rack web applications
#
# Cooked up with style, care and a bit of *secret*
# nerdy spice. :-)