Skip to content

Instantly share code, notes, and snippets.

View rajatmohanty's full-sized avatar

Rajat rajatmohanty

View GitHub Profile
@rajatmohanty
rajatmohanty / FM-fullstack.md
Created April 18, 2020 17:39 — forked from Oliver-ke/FM-fullstack.md
Note on Full Stack development at Frontend Masters

Note on Full Stack development at Frontendmasters.com

note: exclude the leading $ for commands, that just shows it a bash script and is meant to be run in a terminal

Full Stack => Knowing everything up from the front to the back

Frontend can be

  • Cars, -television, -browser, -etc

backend can be

  • API's, -platform, -Database -Security,
import Foundation
@propertyWrapper struct Notifier<Value> {
private let identifier: String
var wrappedValue: Value? {
didSet {
NotificationCenter.default.post(name: Notification.Name(identifier), object: wrappedValue)
}
}
import UIKit
class RootViewController: UIViewController {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
let text = "Cute cat"
let image = UIImage(named: "cat.jpg")!
// Note: you can't wrap the text and image into a single "TextImage" object and selectively return both or one as UIActivityItemSource doesn't like holding arrays
// Download the "video GIF"
let data = try! Data(contentsOf: URL(string: "https://thumbs.gfycat.com/ThankfulLawfulAsianelephant-mobile.mp4")!)
let fileName = String(format: "%@_%@", ProcessInfo.processInfo.globallyUniqueString, "html5gif.mp4")
let url = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(fileName)
try! data.write(to: url, options: [.atomic])
// Do the converties
let asset = AVURLAsset(url: url)
guard let reader = try? AVAssetReader(asset: asset) else {
return
@rajatmohanty
rajatmohanty / setup.sh
Created July 6, 2020 16:48 — forked from chris-sev/setup.sh
Mac Setup
# how to run this thingy
# create a file on your mac called setup.sh
# run it from terminal with: sh setup.sh
#!/bin/bash
set -euo pipefail
# Display message 'Setting up your Mac...'
echo "Setting up your Mac..."
sudo -v
@rajatmohanty
rajatmohanty / postgres-brew.md
Created July 25, 2020 16:44 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update