Skip to content

Instantly share code, notes, and snippets.

View ruwanego's full-sized avatar

Ruwan Egodawatte ruwanego

View GitHub Profile
### 💡 Scenario: Payment Processing System
You have different payment types — `CreditCardPayment`, `PayPalPayment`, etc.
Each follows a common process: **authorize**, **capture**, and **send receipt**, but each one implements these steps differently.
---
### ✅ Step 1 — Interface
Defines *what* operations are possible (the contract).
@ruwanego
ruwanego / index.html
Created February 9, 2024 02:46
template
<!DOCTYPE html>
<html lang="en">
<head>
<title>lineworks</title>
<meta charset="utf-8" />
<meta name="author" content="Ruwan Egodawatte">
<link rel="stylesheet" href="./styles.css" />
<script src="./fxhash.js"></script>
<script src="./p5.min.js"></script>
</head>
air 0.0012
gasoline 0.67
ice 0.9
pure water 1.0
seawater 1.025
human body 1.03
limestone 2.6
granite 2.7
iron 7.8
silver 10.5
@ruwanego
ruwanego / include.asciidoc.txt
Last active May 20, 2020 13:25
A sample AsciiDoc file for testing Asciidoctor.
== Included Section
Look, I came from out of the [blue]#blue#!
--
I'm keepin' it open.
An 'open block', like this one, can contain other blocks.
It can also act as any other block. (TODO)
@ruwanego
ruwanego / Vagrantfile
Created February 7, 2018 12:05
PageBot Vagrant Box
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@ruwanego
ruwanego / Vagrantfile
Created January 19, 2017 13:22
WeasyPrint VagrantBox
# Copyright 2017 Ruwan Egodawatte
# MIT License
# WeasyPrint VagrantBox
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
@ruwanego
ruwanego / laravel.sh
Created October 31, 2012 16:17
download and setup Laravel php framework on Ubuntu with Jeffrey Way's Generator
#!/bin/bash
TMPFILE=tmp.$$
APPLICATION_CONFIG_FILE=application/config/application.php
LARAVEL_GIT=git://github.com/laravel/laravel.git
LARAVEL_GENERATOR_PHP=https://raw.github.com/JeffreyWay/Laravel-Generator/master/generate.php
LOCALHOST=http://localhost/
if [ ! `which git` ]; then
echo "For this installer to work you'll need to install Git."