Skip to content

Instantly share code, notes, and snippets.

View ziyan-junaideen's full-sized avatar
👋
How you doing?

Ziyan Junaideen ziyan-junaideen

👋
How you doing?
View GitHub Profile
@ziyan-junaideen
ziyan-junaideen / .pryrc
Created August 2, 2023 18:36 — forked from devonzuegel/.pryrc
My .pryrc file
# === EDITOR ===
Pry.editor = 'vi'
require 'awesome_print'
# == Pry-Nav - Using pry as a debugger ==
Pry.commands.alias_command 'c', 'continue' rescue nil
Pry.commands.alias_command 's', 'step' rescue nil
Pry.commands.alias_command 'n', 'next' rescue nil
# === CUSTOM PROMPT ===
@ziyan-junaideen
ziyan-junaideen / install-postgresql-9.6-in-ubuntu-16.04.md
Created February 21, 2017 06:33
How to install PostgreSQL 9.6 in Ubuntu 16.04

Background

I believe Ubuntu 16.04 comes with PostgreSQL 9.5. Thats good for a start, but it is a matter of time before you have the need of a PostgreSQL 9.6 cluster. For me it was to import a PG backup from Heroku.

The procedure couldn't have been any easier and is described below. If you are interested in upgrading your old cluster to 9.6 afterwards, you may be interested in this.

Instructions

class A
def initialize(a:)
puts("Initailize A: #{a}")
end
end
class B < A
def initialize(a:, b:)
puts("Initailize B: #{b}")
super(a)
@ziyan-junaideen
ziyan-junaideen / curl_example.sh
Last active June 25, 2022 08:47
Error trying to sign get Net::HTTP to POST to a HTTPS URL through a proxy.
jdeen@iMac:/Volumes/Dev/Work/Edge/edge|ziyan/edg-158-transaction-authorisations-through-vgs⚡
⇒ curl https://eoftqqzi7ii7mmn.m.pipedream.net -vvv --cacert lib/vgs/certs/sandbox.pem \
-x https://$HTTPS_PROXY_USERNAME:$HTTPS_PROXY_PASSWORD@tnttla0t7dc.sandbox.verygoodproxy.com:8443 \
-H "Content-type: application/json" \
-d '{
"card_cvc": "tok_sandbox_sXTRFEQqsidYhF6uwW1w9r",
"card_exp": "10/25",
"card_number": "tok_sandbox_uQPorT8AJ5g4e3727Q93bm"
}'
{
"data": {
"id": "transactionID=dcf22218-17bc-4588-9&recordDate=2019-10-07T16:04:50.994520",
"type": "authorisations",
"attributes": {
"amount": {
"currency": "USD",
"value": 20.99
},
"transactionStatus": "999",
{
"data": {
"type": "donations",
"id": "123456",
"attributes": {
"formatted-amount": "$100.00",
"amount": 10000,
"comments": "Test Donation",
"recurring": true,
"frequency": 0,
@ziyan-junaideen
ziyan-junaideen / gist:d89c3b7c2a4fb04ab05ff2454f1878b1
Created October 4, 2019 09:18
Scripting within a VSCode Snippet
def initialize(${1})
<split ${1} by comma and for each split>
@{split} = #{split}
<end>
end
# So that some thing like this `def initialize(a, b)` would result
def initialize(a, b)
@a = a
app=decidim
sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt update
sudo apt dist-upgrade
sudo apt install software-properties-common
sudo apt install imagemagick libmagickwand-dev
sudo apt install postgresql postgresql-contrib libpq-dev
sudo apt install redis-server
sudo apt install nodejs
@ziyan-junaideen
ziyan-junaideen / gist:ae130622699fc32249588a586560f85b
Created August 19, 2018 17:20
Ubuntu Setup for Basic Rails - I know, working on
sudo apt -y install imagemagick libmagickcore-dev libmagickwand-dev
sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt update
sudo apt install rvm
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
@ziyan-junaideen
ziyan-junaideen / ideas_controller.rb
Last active August 3, 2018 03:00
I am trying to load a resource through cancancan. How ever they end up nil. Am I missing some thing?
class Management::Budgets::IdeasController < Management::BaseController
load_resource :budget
load_resource :investment, through: :budget, class: 'Budget::Investment'
def index
# @investments = nil
end
def new