Skip to content

Instantly share code, notes, and snippets.

:octocat:

Anthony Lee antwonlee

:octocat:
Block or report user

Report or block antwonlee

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@antwonlee
antwonlee / nginx-passenger-ssl.conf
Created Mar 26, 2019 — forked from rkjha/nginx-passenger-ssl.conf
Nginx/Passenger config when using SSL with a Ruby/Rails Application.
View nginx-passenger-ssl.conf
# for redirecting hhtp traffic to https version of the site
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri;
}
# for redirecting to non-www version of the site
server {
listen 80;
View intercom.erb
window.intercomSettings = {
app_id: "APP_ID",
hide_default_launcher: true,
email: '<%= current_user.email %>',
name: '<%= current_user_full_name %>',
first_name: '<%= current_user.first_name %>',
last_name: '<%= current_user.last_name %>',
user_hash: '<%= OpenSSL::HMAC.hexdigest("sha256", ENV["INTERCOM_SECRET"], current_user.id.to_s) %>',
created: '<%= current_user.created_at %>',
avatar: {
@antwonlee
antwonlee / countries
Created Feb 5, 2018 — forked from kalinchernev/countries
Plain text list of countries
View countries
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria
@antwonlee
antwonlee / countries
Created Feb 5, 2018 — forked from kalinchernev/countries
Plain text list of countries
View countries
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria
@antwonlee
antwonlee / schema.rb
Last active Feb 3, 2018
Clean, Organized, Mirror
View schema.rb
create_table "students", id: :serial, force: :cascade do |t|
t.string "birth_year", limit: 255, null: false
t.string "country", limit: 255, null: false
t.string "first_name", limit: 255, null: false
t.string "last_name", limit: 255, null: false
t.string "student_status", limit: 255
t.text "story", null: false
t.integer "organization_id"
t.index ["organization_id"], name: "index_students_on_organization_id"
end
@antwonlee
antwonlee / insert_cursor.vim
Created Nov 3, 2017
Terminal vim to have insert cursor
View insert_cursor.vim
" set the cursor to a vertical line in insert mode and a solid block
" " in command mode
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
@antwonlee
antwonlee / HOWTO.md
Created Feb 26, 2017 — forked from cvan/HOWTO.md
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default
View HOWTO.md

Instructions

CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you
@antwonlee
antwonlee / doc.md
Created Feb 16, 2017 — forked from oelmekki/doc.md
Rails + Browserify + React + es7
View doc.md

1. Gemfile

gem 'browserify-rails', '1.5.0' # until fix: https://github.com/browserify-rails/browserify-rails/issues/101
gem 'react-rails'

Browserify-rails allows to use browserify within assets pipeline. React-rails is here only to allow to use #react_component (and thus, prerendering).

Note that jquery-rails can be removed from Gemfile, the npm version of jquery and jquery-ujs will be used instead.

View countdown.html
// Replace this:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
// with this jQuery CDN:
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
// or the full path:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
View gist:f4f99ba68622f15cf2917b169ccec20a
### Keybase proof
I hereby claim:
* I am antwonlee on github.
* I am anthonylee (https://keybase.io/anthonylee) on keybase.
* I have a public key whose fingerprint is D330 93CF C9F3 530E A6AC 4932 7C74 4637 D05D 00B0
To claim this, I am signing this object:
You can’t perform that action at this time.