Skip to content

Instantly share code, notes, and snippets.

View rajatmohanty's full-sized avatar

Rajat rajatmohanty

View GitHub Profile
@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
@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
// 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
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
import Foundation
@propertyWrapper struct Notifier<Value> {
private let identifier: String
var wrappedValue: Value? {
didSet {
NotificationCenter.default.post(name: Notification.Name(identifier), object: wrappedValue)
}
}
@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,
@rajatmohanty
rajatmohanty / curl.md
Created November 19, 2019 10:27 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@rajatmohanty
rajatmohanty / introrx.md
Created August 4, 2018 17:52 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@rajatmohanty
rajatmohanty / GitConfigHttpProxy.md
Created July 27, 2018 10:45 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

##In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@rajatmohanty
rajatmohanty / reinvent-2017-youtube.md
Created January 6, 2018 16:34 — forked from stevenringo/reinvent-2017-youtube.md
Links to YouTube recordings of AWS re:Invent 2017 sessions

| Title | Description