Skip to content

Instantly share code, notes, and snippets.

View duccuong2808's full-sized avatar
🔍
Learning and Working

CuongND duccuong2808

🔍
Learning and Working
  • Ha Noi - Vietnam
View GitHub Profile
// source: https://gist.github.com/dperini/729294
// Example: https://regex101.com/r/8HKdZ0/1
var regexHttp = /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/;
@duccuong2808
duccuong2808 / - Global Config Collection -.md
Last active December 31, 2018 03:08
Global Config Collection

Global Config Collection:

  • .editorconfig
  • .gitignore
  • Gemfile
@duccuong2808
duccuong2808 / job_interview_qs.md
Last active November 19, 2018 06:31 — forked from amysimmons/job_interview_qs.md
Job Interview Questions

Job Interview Questions

A team

What is Rails?

Rails is an open source web application framework written in Ruby. It is a full-stack framework that has been optimised for programmer happiness and sustainable productivity. It emphasises the use of well-known software engineering patterns and paradigms, including convention over configuration (CoC), don't repeat yourself (DRY), the active record pattern, and model–view–controller (MVC).

Extra: David Heinemeier Hansson (DHH) is the creator of Rails, having extracted it from his work on Basecamp. He first released Rails as open source in July 2004.

118.69.192.84 vozforums.com

###I. Setup environment Có thể sử dụng 1 trong 2 cách sau

1.** Vagrant**

Download and install https://www.vagrantup.com/downloads.html Trong cmd , trong thư mục C:\Vagrant, chạy lệnh

vagrant init bivee/rails; # kéo image bivee/rails về máy
vagrant up --provider virtualbox # chạy máy ảo vagrant
@duccuong2808
duccuong2808 / regexp.rb
Created September 16, 2015 16:27
regex rules for validate url
class Regexp
PERFECT_URL_PATTERN = %r{
\A
# protocol identifier
(?:(?:https?|ftp)://)
# user:pass authentication
(?:\S+(?::\S*)?@)?
@duccuong2808
duccuong2808 / eclipse_key_for_sublimetext
Last active August 29, 2015 14:13 — forked from thbkrkr/Default (Linux).sublime-keymap
eclipse_key_for_sublimetext
[
{ "keys": ["f12"], "command": "htmlprettify"},
{ "keys": ["f1"], "command": "fold" },
{ "keys": ["f2"], "command": "unfold" },
{ "keys": ["ctrl+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
{ "keys": ["ctrl+space"], "command": "auto_complete" },
{ "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context":
[
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
@duccuong2808
duccuong2808 / vim74_lua
Last active August 29, 2015 14:13 — forked from jdewit/vim74_lua
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo rm -rf /usr/local/share/vim
sudo rm /usr/bin/vim
@duccuong2808
duccuong2808 / TomDoc 1.0.0-rc1.md
Last active August 29, 2015 14:10
TomDoc 1.0.0-rc1

#TomDoc for Ruby - Version 1.0.0-rc1

I. Purpose

TomDoc is a code documentation specification that helps you write precise documentation that is nice to read in plain text, yet structured enough to be automatically extracted and processed by a machine.

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

II. Method Documentation

A quick example will serve to best illustrate the TomDoc method documentation format:

@duccuong2808
duccuong2808 / redis_fedora.md
Created November 19, 2014 16:10
Redis for fedora

Redis

Install Redis

sudo yum install redis

Action for Redis

  • Start Server