This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// ExampleDailyMotion | |
// | |
// Created by Philip Young on 2023-05-11. | |
// | |
import SwiftUI | |
import DailymotionPlayerSDK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// Shared | |
// | |
// Created by Philip Young on 2022-03-24. | |
// | |
import SwiftUI | |
struct CustomTextField: View, Equatable { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// test | |
// | |
// Created by Philip Young on 16/04/21. | |
// | |
import SwiftUI | |
struct Item: Identifiable { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as redis from "redis"; | |
import * as Websocket from "ws"; | |
import { v4 } from "uuid"; | |
import * as http from "http"; | |
function noop() {} | |
enum WebsocketSendType { | |
BROADCAST_EMIT = "BROADCAST_EMIT", | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum ObjectId { | |
case Session(SessionType) | |
case SessionStatus(SessionStatusType) | |
} | |
enum SessionType { | |
case SessionAdd(SessionAddPayload) | |
case SessionEdit(SessionEditPayload) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
protocol VercelPayload { | |
var name: String {get} | |
var id: String {get} | |
} | |
struct GitBucket: VercelPayload, Codable { | |
var name: String | |
var id: String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// mocks | |
const mockUser = {} | |
const mockGoals = [] | |
// endpoint | |
enum ApiEndpoint { | |
FetchAllGoals = '/goals', | |
CurrentUser = '/user', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// guards | |
const gteNewDragIndex = (c, e) => c.snapshot.index >= e.newDragIndex; | |
const gtNewDragIndex = (c, e) => c.snapshot.index > e.newDragIndex; | |
const lteNewDragIndex = (c, e) => c.snapshot.index <= e.newDragIndex; | |
const ltNewDragIndex = (c, e) => c.snapshot.index < e.newDragIndex; | |
const sameDropId = (c, e) => c.snapshot.dropId === e.destinationDropId; | |
const mismatchType = (c, e) => e.initialSnapshot.dropType !== c.snapshot.dropType; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// guards | |
const gteNewDragIndex = (c, e) => c.snapshot.index >= e.newDragIndex; | |
const gtNewDragIndex = (c, e) => c.snapshot.index > e.newDragIndex; | |
const lteNewDragIndex = (c, e) => c.snapshot.index <= e.newDragIndex; | |
const ltNewDragIndex = (c, e) => c.snapshot.index < e.newDragIndex; | |
const sameDropId = (c, e) => e.snapshot.dropId === e.destinationDropId; | |
const mismatchType = (c, e) => | |
e.initialSnapshot.dropType !== e.snapshot.dropType; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As I have hard time understanding the same issue, I decided to take a peek from Ramda's source code. Will write a blogpost about `this`. Meanwhile—I made a commented gist how Ramda's `lift` work step by step. | |
from: https://gist.github.com/philipyoungg/a0ab1efff1a9a4e486802a8fb0145d9e | |
// Let's make an example function that takes an object and return itself. | |
// 1. Ramda's lift level | |
lift(zipObj)(keys, values)({a: 1}) // returns {a: 1} | |
// this is how lift works in the background | |
module.exports = _curry2(function liftN(arity, fn) { |