Skip to content

Instantly share code, notes, and snippets.

@mrkurt
mrkurt / regex.js
Last active October 10, 2018 15:59
Kurt
import proxy from "@fly/proxy"
import { forceSSL } from './lib/utilities'
const origin = proxy("https://viaglamour.com/")
/**
* Rewrite the path to /store/<hostname>
*/
function rewriteRequest(req) {
const url = new URL(req.url)
let path = "/store/" + url.hostname.replace(/\.[a-z]+/, '')
<h3>Hours Worked</h3>
<% user_signed_in? %>
<table>
<table class="table table-striped table-bordered table-condensed table-hover">
<thead>
<thead>
<tr>
<th>Date</th>
<th>Hours Worked</th>
<th>Start</th>
@mrkurt
mrkurt / retry.rb
Created March 30, 2012 20:26 — forked from bhbryant/retry.rb
auto-failover ReplicaSet config for MongoMapper, by way of ruby driver
replica_sets = mm_env['replica_sets'] # node1:port&node2:port
rs_list = replica_sets.split("&").map {|rs| host,port = rs.split(":"); [host,port.to_i] }
MongoMapper.connection = Mongo::RetryReplicaSetConnection.new(*(rs_list << {:read_secondary => true, :auto_refresh => true }))
MongoMapper.database = mm_env['database']
MongoMapper.database.authenticate(mm_env['username'], mm_env['password'])