Skip to content

Instantly share code, notes, and snippets.

View awinabi's full-sized avatar
🎯
Focusing

Awin Abi awinabi

🎯
Focusing
View GitHub Profile
@awinabi
awinabi / .gitignore
Created February 2, 2021 04:10
django gitignore
# Created by https://www.toptal.com/developers/gitignore/api/django
# Edit at https://www.toptal.com/developers/gitignore?templates=django
### Django ###
*.log
*.pot
*.pyc
__pycache__/
local_settings.py
@awinabi
awinabi / kinds-pc.md
Last active June 22, 2019 14:44
Raspberry Pi based low cost PC configuration

KindsPC

Configuration 1

Components

  • Raspberry Pi B+ Board: 2990/-

  • Case 150/-

  • Fan 150/-

  • Monitor: 2900 - 3300/-

@awinabi
awinabi / vue-cheatsheet.md
Last active May 8, 2019 10:31
Vue 2 Cheatsheet

Vue 2 Cheatsheet

  • Vue instance
    var app = new Vue({
      el: '#app',
      data: {
        message: 'Hello World'
    

}

@awinabi
awinabi / Capybara.md
Created March 25, 2019 18:32 — forked from tomas-stefano/Capybara.md
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
@awinabi
awinabi / gist:559990d856993619b33f7ec115bb8f57
Created March 8, 2019 10:07 — forked from victorlhlam/gist:7019359
Rails 3.1+ force_ssl & HSTS problem

Rails 3.1 introduced force_ssl. You can add config.force_ssl = true in application.rb.

By enabling force_ssl, Rails send a HSTS (HTTP Strict Transport Security) header which will expired in a year.

So if you enabled force_ssl once, even you change the config value to false later, the browser you used to open you app before will still remember this website (using domain to identify) require to use HTTPS, and redirect you to HTTPS connection automatically. You may use chrome://net-internals/#hsts to check the domain list in Google Chrome.

@awinabi
awinabi / one.rb
Last active December 23, 2018 13:24
Duplex is a ready to deploy, mobile and web application - powered by Ionic 3 and Ruby on Rails. Namespacing is a way of bundling logically related objects together. https://bit.ly/dupl3x
print 'hello world'
@awinabi
awinabi / ssl_puma.sh
Last active October 21, 2016 14:13 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
# 3) Generate the csr (Certificate signing request) (Details are important!)
@awinabi
awinabi / install-comodo-ssl-cert-for-nginx.rst
Created May 24, 2016 12:41 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@awinabi
awinabi / successdart-mina.rb
Created May 18, 2016 19:01
Mina for SD in AWS
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv'
require 'mina/unicorn'
# Basic settings:
# domain - The hostname to SSH to.
# deploy_to - Path to deploy into.
# repository - Git repo to clone from. (needed by mina/git)