Skip to content

Instantly share code, notes, and snippets.

View raviwu's full-sized avatar

Ravi Wu raviwu

  • Taiwan
View GitHub Profile
@raviwu
raviwu / notes_soft_skills.md
Last active May 5, 2022 06:43
[Notes] Soft Skills: The software developer's life manual

Page 47

This kind of mindset is crucial to managing your career, because when you start to think of yourself as a business, you start to make good business decisions.

Page 52

Every step you take without a clear direction is a wasted step. Don’t randomly walk through life without a purpose for your career.

Your big goal should be something not too specific, but clear enough that you can know if you’re steering toward it or not. Think about what you want to ultimately do with your career.

@raviwu
raviwu / rspec_pattens.rb
Last active February 2, 2017 08:00
RSpec Patterns
# app/models/user.rb
class User < ActiveRecord::Base
has_secure_password
validates :firstname, presence: true, length: 4..20
validates :middlename, length: 4..20, allow_blank: true
validates :lastname, presence: true, length: 4..20
validates :email, format: { with: /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/i }
validates :password, presence: true, confirmation: true, length: { minimum: 8 }
@raviwu
raviwu / elixir-programming-notes.md
Last active February 8, 2017 10:01
Elixir Notes

Chapter 2 - Pattern Matching

Simple Match operator =

In Elixir, the equals sign = is not an assignment, instead i's like an assertion. It succeeds if Elixir can find a way of making the left-hand side equal the right-hand side. Elixir calls = a match operator.

a = 1
=> 1
@raviwu
raviwu / common_regex.rb
Created February 14, 2017 07:33
Common Regex
# URL with http:// or https://
%r{\A(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?\z}ix
# email
/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
@raviwu
raviwu / Dockerfile
Created March 15, 2019 06:28
CentOS openJDK Dockerfile
FROM centos:7
RUN yum -y update && yum -y install java-1.8.0-openjdk java-1.8.0-openjdk-devel epel-release libffi-devel gcc-c++ make openssl-devel git sudo
ENV JAVA_HOME /etc/alternatives/jre
# Add entrypoint script
ADD scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]