Skip to content

Instantly share code, notes, and snippets.

View xxswingxx's full-sized avatar
🏠
Working from home

John Wu xxswingxx

🏠
Working from home
View GitHub Profile
@fnky
fnky / stripe-keys-and-ids.tsv
Last active March 29, 2024 22:52
Stripe keys and IDs
Prefix Description Notes
ac_ Platform Client ID Identifier for an auth code/client id.
acct_ Account ID Identifier for an Account object.
aliacc_ Alipay Account ID Identifier for an Alipay account.
ba_ Bank Account ID Identifier for a Bank Account object.
btok_ Bank Token ID Identifier for a Bank Token object.
card_ Card ID Identifier for a Card object.
cbtxn_ Customer Balance Transaction ID Identifier for a Customer Balance Transaction object.
ch_ Charge ID Identifier for a Charge object.
cn_ Credit Note ID Identifier for a Credit Note object.
@j15e
j15e / add_frozen_string_comment.py
Created July 4, 2019 21:00
Sublime Text 3 automatically add frozen string literal: true
# Add to ~/Library/Application Support/Sublime Text 3/Packages/User/
import sublime
import sublime_plugin
class RubyFileSaveListener(sublime_plugin.EventListener):
def on_pre_save(self, view):
file_name = view.file_name()
if file_name.endswith('schema.rb'):
return
@mpociot
mpociot / quaderno-checkout-v2.md
Created March 1, 2019 09:06 — forked from xxswingxx/quaderno-checkout-v2.md
Quaderno Checkout v2 reference (deprecated)
@robhrt7
robhrt7 / MySQL_5-7_macOS.md
Last active February 28, 2024 03:48 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@Pablo-R
Pablo-R / lcd.rb
Created September 19, 2017 10:50
LCD Numbers Another Version
#!/usr/bin/ruby
class LCDNumber
def initialize(size, input_number)
@input_number = input_number
@size = size
@display_code = [
['horizontal_line_yes', 'vertical_line_both', 'horizontal_line_no', 'vertical_line_both', 'horizontal_line_yes' ],
['horizontal_line_no', 'vertical_line_right', 'horizontal_line_no', 'vertical_line_right', 'horizontal_line_no' ],
@Pablo-R
Pablo-R / lcd.rb
Created September 19, 2017 10:49
LCD Numbers
#!/usr/bin/ruby
class LCDNumber
def initialize(size, input_number)
@input_number = input_number
@size = size
@symbol_style = {
horizontal_line_yes: " " + "-" * @size + " ",
vertical_line_both: ["|" + " " * @size + "|"] * @size,
@tinogomes
tinogomes / DNS_TO_LOCALHOST.markdown
Last active April 15, 2024 07:22
Public DNS Pointing to localhost (127.0.0.1)

Available Public Wildcard DNS Domains pointing to localhost (127.0.0.1)

The best way to safely and securely use local domains pointing to 127.0.0.1 is to edit your local settings (/etc/hosts) and add your own settings. Keep in mind if you want to use subdomains, you need to enter all variations.

Example:

# Adding bottom of your current file /etc/hosts
################# MY LOCAL DOMAINS
127.0.0.1 local.com admin.local.com
127.0.0.1 domain1.com
@ArturT
ArturT / Fix OpenSSL Padding Oracle vulnerability (CVE-2016-2107) - Ubuntu 14.04
Last active June 20, 2018 11:46
Fix OpenSSL Padding Oracle vulnerability (CVE-2016-2107) - Ubuntu 14.04
# Based on http://fearby.com/article/update-openssl-on-a-digital-ocean-vm/
$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ wget ftp://ftp.openssl.org/source/openssl-1.0.2h.tar.gz
$ tar -xvzf openssl-1.0.2h.tar.gz
$ cd openssl-1.0.2h
$ ./config --prefix=/usr/
$ make depend
@wojtha
wojtha / Locales.yaml
Created January 15, 2014 10:13 — forked from s-andringa/Locales.yml
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"
@joost
joost / webhooks_controller.rb
Last active February 4, 2021 13:39
Mandrill API Webhook signature verification. This shows how you could verify a Mandrill signature in a Rails Controller.
class WebhooksController < ActionController::Base
WEBHOOK_KEY = "some_key" # You could also use an API request to lookup the key
before_filter :verify_request_signature
# See: http://help.mandrill.com/entries/23704122-Authenticating-webhook-requests
def verify_request_signature
signed_data = request.url
post_params = request.request_parameters.dup # POST parameters