Skip to content

Instantly share code, notes, and snippets.

View giangstrider's full-sized avatar

Giang Trinh giangstrider

View GitHub Profile
@giangstrider
giangstrider / kube-spark-kafka-cassandra.sh
Created January 9, 2019 08:45 — forked from navicore/kube-spark-kafka-cassandra.sh
A set of scripts to deploy Spark standalone, Kafka, and Cassandra in Kubernetes
#!/usr/bin/env bash
#
# presumes you have a working kubernetes cluster and
# healthy local kubectl install and config
#
#
# if you want to customize,
# - comment out the last line
# - edit build/*.yaml files
---
- hosts: all
remote_user: "{{ ansible_user }}"
vars_files:
- group_vars/webserver.yml
sudo: yes
roles:
- { role: php }
- { role: geerlingguy.composer }
[localhost]
127.0.0.1
[testing]
188.166.217.133
[testing:vars]
ansible_user=root
[database]
@giangstrider
giangstrider / challenge.rb
Last active March 1, 2017 13:14
Codewar Christmas Challenge
require 'benchmark'
require 'bigdecimal/math'
def guess_gifts(wishlist, presents)
results = []
refactored_wishlist = Hash.new { |h,k| h[k] = [] }
wishlist.each do |value|
refactored_wishlist[{size: value[:size], clatters: value[:clatters], weight: value[:weight]}] << value[:name]
end
@giangstrider
giangstrider / db.rake
Created October 17, 2016 03:31 — forked from hopsoft/db.rake
Rails rake tasks for dump & restore of PostgreSQL databases
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
end
puts cmd
@giangstrider
giangstrider / frp.md
Created January 22, 2016 03:30 — forked from ohanhi/frp.md
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Foreword

@giangstrider
giangstrider / gist:58393fa62486eb6ad11c
Last active August 29, 2015 14:27 — forked from ryansobol/gist:5252653
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.