Skip to content

Instantly share code, notes, and snippets.

View rogerluo410's full-sized avatar
🏠
Working at home

Roger Luo rogerluo410

🏠
Working at home
View GitHub Profile
@rogerluo410
rogerluo410 / gencert.sh
Last active August 29, 2015 14:07 — forked from bradland/gencert.sh
Generate a self-signed SSL cert
#!/bin/bash
# Bash shell script for generating self-signed certs. Run this in a folder, as it
# generates a few files. Large portions of this script were taken from the
# following artcile:
#
# http://usrportage.de/archives/919-Batch-generating-SSL-certificates.html
#
# Additional alterations by: Brad Landers
# Date: 2012-01-27
@rogerluo410
rogerluo410 / generate_ssl_cert.sh
Created October 8, 2014 09:41
Generate a self-signed SSL cert V1
#! /bin/bash
# Script accepts a single argument, the fqdn for the cert
DOMAIN="$1"
if [ -z "$DOMAIN" ]; then
echo "Usage: $(basename $0) <domain>"
exit 11
fi
require 'active_record'
ActiveRecord::Base.logger = Logger.new(STDERR)
ActiveRecord::Base.colorize_logging = false
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:database => ":memory:"
)
@rogerluo410
rogerluo410 / Ruby_questions.md
Last active December 6, 2017 15:09 — forked from ryansobol/gist:5252653
Ruby on rails Questions

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.

@rogerluo410
rogerluo410 / ruby interview questions
Last active September 5, 2022 02:10
ruby interview questions
http://www.geekinterview.com/Interview-Questions/J2EE/Ruby
http://www.toptal.com/ruby/interview-questions --10 Great Ruby Interview Questions
http://srikantmahapatra.wordpress.com/2013/11/07/ruby-on-rails-interview-questions-and-answers/ --ruby on rails
What Ruby and Rails Developers Ought To Know?:
##Senior:
@rogerluo410
rogerluo410 / markdown.md
Last active August 29, 2015 14:08
markdown

@(示例笔记本)[马克飞象|帮助|Markdown]

马克飞象是一款专为印象笔记(Evernote)打造的Markdown编辑器,通过精心的设计与技术实现,配合印象笔记强大的存储和同步功能,带来前所未有的书写体验。特点概述:

  • 功能丰富 :支持高亮代码块、插入 LaTex 公式,工作学习好帮手
  • 得心应手 :支持插入图片,无论是本地上传/图片URL/拖放图片/直接截图粘贴,随心所欲
  • 深度整合 :支持选择笔记本和添加标签,支持从印象笔记跳转编辑,轻松管理

号外号外,离线客户端来啦!点击下载

@rogerluo410
rogerluo410 / cancan_matchers.rb
Created January 28, 2016 07:03 — forked from fotinakis/cancan_matchers.rb
Custom rspec matcher for testing CanCan abilities
# Custom rspec matcher for testing CanCan abilities.
# Originally inspired by https://github.com/ryanb/cancan/wiki/Testing-Abilities
#
# Usage:
# should have_abilities(:create, Post.new)
# should have_abilities([:read, :update], post)
# should have_abilities({manage: false, destroy: true}, post)
# should have_abilities({create: false}, Post.new)
# should not_have_abilities(:update, post)
# should not_have_abilities([:update, :destroy], post)
@rogerluo410
rogerluo410 / Locales.yaml
Created January 29, 2016 07:10 — forked from wojtha/Locales.yaml
config.exceptions_app and ExceptionController
# config/locales/en.yml
en:
exception:
show:
not_found:
title: "Not Found"
description: "The page you were looking for does not exists."
internal_server_error:
title: "Internal Server Error"
@rogerluo410
rogerluo410 / Omniauth_Strategy_Weibo.rb
Created February 16, 2016 02:56 — forked from krongk/Omniauth_Strategy_Weibo.rb
Omniauth Strategy Weibo 新浪微博Oauth2
#C:\Sites\tm_wed\lib\omniauth\strategies\weibo.rb
# Updated at: 2014-09-04
# Author: we@wedxt.com
require 'omniauth-oauth2'
module OmniAuth
module Strategies
class Weibo < OmniAuth::Strategies::OAuth2
@rogerluo410
rogerluo410 / Omniauth_Strategy_Douban.rb
Created February 16, 2016 02:57 — forked from krongk/Omniauth_Strategy_Douban.rb
Omniauth Strategy Douban 豆瓣Oauth2
#C:\Sites\tm_wed\lib\omniauth\strategies\douban.rb
# Updated at: 2014-09-04
# Author: we@wedxt.com
require 'omniauth-oauth2'
module OmniAuth
module Strategies
class Douban < OmniAuth::Strategies::OAuth2
DEFAULT_SCOPE = 'douban_basic_common,shuo_basic_r,shuo_basic_w'