Skip to content

Instantly share code, notes, and snippets.

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

Barnabas Makonda makoscafee

🏠
Working from home
View GitHub Profile
import SwiftUI
struct ContentView: View {
@State private var startOffset: CGFloat = 280
@State private var endOffset: CGFloat = 0
var body: some View {
// Main View
@makoscafee
makoscafee / raspberry-pi-vpn-router.md
Created November 24, 2020 18:44 — forked from superjamie/raspberry-pi-vpn-router.md
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

import SwiftUI
let lightGreen = UIColor(red: 11/255, green: 224/255, blue: 93/255, alpha: 1)
let darkGreen = UIColor(red: 0/255, green: 213/255, blue: 75/255, alpha: 1)
struct ContentView: View {
var body: some View {
ZStack {
Color(darkGreen)
//
// BottomSheetView.swift
//
// Created by Majid Jabrayilov
// Copyright © 2019 Majid Jabrayilov. All rights reserved.
//
import SwiftUI
fileprivate enum Constants {
static let radius: CGFloat = 16
@makoscafee
makoscafee / ContentView.swift
Created June 21, 2020 08:48 — forked from mshafer/ContentView.swift
Slide-over card (like in Maps or Stocks) using SwiftUI
import SwiftUI
struct ContentView : View {
var body: some View {
ZStack(alignment: Alignment.top) {
MapView()
SlideOverCard {
VStack {
CoverImage(imageName: "maitlandbay")
Text("Maitland Bay")
@makoscafee
makoscafee / reduce-lvm-partition-centos-7.md
Last active October 5, 2020 09:40 — forked from fernandoaleman/reduce-lvm-partition-centos-7.md
Reduce an LVM partition on CentOS 7

Reduce LVM Partition on CentOS 7

Sometimes when creating a new CentOS 7 server, the drive is partioned with the root, boot and swap, and then all the rest of the space is given to the home directory.

Here, we are going to reduce the size of the /home partition and allocate the remaining space back to the root partition.

List Block Devices

List the current block devices

@makoscafee
makoscafee / dump-restore
Last active March 14, 2020 14:46 — forked from ricjcosme/dump-restore
DUMP / RESTORE PostgreSQL Kubernetes
DUMP
// pod-name name of the postgres pod
// postgres-user database user that is able to access the database
// database-name name of the database
kubectl exec [pod-name] -- bash -c "pg_dump -U [postgres-user] [database-name]" > database.sql
RESTORE
// pod-name name of the postgres pod
// postgres-user database user that is able to access the database
// database-name name of the database
[
["5","3",".",".","7",".",".",".","."],
["6",".",".","1","9","5",".",".","."],
[".","9","8",".",".",".",".","6","."],
["8",".",".",".","6",".",".",".","3"],
["4",".",".","8",".","3",".",".","1"],
["7",".",".",".","2",".",".",".","6"],
[".","6",".",".",".",".","2","8","."],
[".",".",".","4","1","9",".",".","5"],
@makoscafee
makoscafee / (Example)combined-enrollment-and-event.json
Created February 19, 2019 08:54
Data Payload for Tracker Program Enrolment and Events Submission.
{
"trackedEntityType": "nEenWmSyUEp",
"orgUnit": "DiszpKrYNg8",
"attributes": [
{
"attribute": "w75KJ2mc4zz",
"value": "Joe"
},
{
"attribute": "zDhUuAYrxNC",
{events:[
{
"status": "COMPLETED",
"program": "PI7qwgoIpq8",
"programStage": "CcPf9cIg1zc",
"orgUnit": "DiszpKrYNg8",
"storedBy": "admin",
"eventDate": "2019-02-12",
"dataValues": [
{ "dataElement": "EdOZNERIYoY", "value": "1342424242" },