Skip to content

Instantly share code, notes, and snippets.

View dlcmh's full-sized avatar
💭
Hybridizing...

David Chin dlcmh

💭
Hybridizing...
View GitHub Profile
@rrafal
rrafal / pgx_json.go
Created March 31, 2016 00:03
Use JSON column with golang pgx driver.
package main
import (
"fmt"
"encoding/json"
"github.com/jackc/pgx"
"log"
)
var schema = `
@calumhalcrow
calumhalcrow / hivekind_engineer_skills_test.md
Last active March 10, 2022 22:49 — forked from nickmarden/senior_eng_skills_test.md
Hivekind Engineer skills test

NOTE: Please send your answers to careers@hivekind.com rather than post them publicly in another Gist or in comments on this Gist.

1. Voting

Each voter can vote in zero or more referenda. Each referendum has one or more questions, and each question is a yes/no vote. Write the simplest normalized schema to describe this in generic SQL statements or as an entity-relationship diagram. Point out where the indexes would be if you want to quickly know the results of a given referendum question, but you never expect to query a single voter's voting record.

2. Availability on AWS

Your client plans to host their web application on AWS. When would you advise (a) deployment in a single availability zone, (b) deployment in multiple availability zones in a single region (c) deployment in multiple regions? What operational difficulty or complexity, if any, is added as you go from (a) to (b) to (c)?

@ericlbarnes
ericlbarnes / app.js
Created July 22, 2015 02:18
Example delete request
$(document).ready(function() {
$("button.remove").on('click', function(e){
e.preventDefault();
if ( ! confirm('Are you sure?')) {
return false;
}
var action = $(this).data("action");
var parent = $(this).parent();
$.ajax({
type: 'delete',
@thebucknerlife
thebucknerlife / authentication_with_bcrypt_in_rails_4.md
Last active January 17, 2024 23:54
Simple Authentication in Rail 4 Using Bcrypt

#Simple Authentication with Bcrypt

This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.

The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).

You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault

##Steps