Skip to content

Instantly share code, notes, and snippets.

View leovido's full-sized avatar
🎩
Just build it

Christian Leovido leovido

🎩
Just build it
View GitHub Profile
// Visit https://iamng.wtf/widgets/fc-degen/points for installation instructions
// 1. Install Scriptable from the App Store
// 2. Create a new script once downloaded clicking the plus button (clicking on the Untitled title will allow you to name the script; I suggest naming it Ham widget)
// 3. Copy the following code:
const scriptURL = 'https://masks-widget.leovido.xyz/api/widget-script?fid=' + encodeURIComponent(args.widgetParameter || 'yourFID');
const script = await new Request(scriptURL).loadString();
eval(script);
// 4. Replace 'yourFID' with your Farcaster/Warpcast FID (you can find this in your own profile, clicking on the about button)
@leovido
leovido / le-ham-widget-v2.0.0.txt
Last active June 22, 2024 13:59
Ham widget (iOS) - Farcaster (by leovido.eth)
// Visit https://iamng.wtf/widgets/fc-degen/points for installation instructions
// 1. Install Scriptable from the App Store
// 2. Create a new script once downloaded clicking the plus button (clicking on the Untitled title will allow you to name the script; I suggest naming it Ham widget)
// 3. Copy the following code:
const scriptURL = 'https://ham-api.leovido.xyz/api/widget-script?fid=' + encodeURIComponent(args.widgetParameter || 'yourFID');
const script = await new Request(scriptURL).loadString();
eval(script);
// 4. Replace 'yourFID' with your Farcaster/Warpcast FID (you can find this in your own profile, clicking on the about button)
@leovido
leovido / feature-flags.ts
Created July 19, 2023 05:59
Feature flags - Example for preserving existing components
const fancyFeatureFlagEnabled = featureFlagService("fancy_feature")
if (fancyFeatureFlagEnabled) {
<App />
} else {
<NewApp />
}
// App.tsx
public enum ImageLoaderError: Error, Equatable {
case invalidData
case imageLoadingFailed
case message(String)
}
public struct ImageState: Equatable {
public var image: UIImage?
}
@leovido
leovido / onurgenes-combine-book-giveaway
Last active November 12, 2020 12:11
Code to pick a random winner for the "Practical Combine" book by Donny Wals written in Combine; this is a giveaway from Twitter user: @onurgenes
import Combine
typealias TwitterUserName = String
enum BookGiveawayError: Error {
case noUserCommented
}
final class BookGiveaway: ObservableObject {
@leovido
leovido / Mock+AVFoundation.swift
Last active September 23, 2020 12:00
Mock example for AVFoundation code. This will allow to pass in default values and to isolate testing for specific interfaces. In this example, it mocks the AVCaptureSession through the SessionCapturable.
import Foundation
import AVFoundation
enum CameraPosition {
case front
case back
}
// interface with functions that our app uses for AVCaptureSession
protocol SessionCapturable {
@leovido
leovido / resume.json
Last active March 12, 2020 22:18
Resume 2020
{"basics":{"name":"Christian Ray Leovido","picture":"https://avatars1.githubusercontent.com/u/18484997?v=4","label":"iOS Developer","headline":"iOS Developer (Swift)","summary":"I am passionate about delivering bulletproof tested code for the highest quality that is maintainable, readable and flexible.","website":"accentpos.com","blog":null,"yearsOfExperience":4,"id":"99e35374-4ddf-4a05-9c5e-0f502981ec89","username":"kuriishu27","karma":10,"email":"[email protected]","region":"London, UK","location":{},"phone":"07756684275","followers":7,"following":18,"profiles":[{"network":"gitconnected","username":"kuriishu27","url":"https://gitconnected.com/kuriishu27"},{"network":"GitHub","username":"kuriishu27","url":"https://github.com/kuriishu27"},{"network":"LinkedIn","url":"https://www.linkedin.com/in/christianleovido/","username":"christianleovido"},{"network":"Stack Overflow","url":"https://stackoverflow.com/users/story/6450266","username":"6450266"}]},"skills":[{"name":"Swift","level":"Advanced","rating