Skip to content

Instantly share code, notes, and snippets.

View neuroswish's full-sized avatar
🎯
Focusing

Kiran neuroswish

🎯
Focusing
View GitHub Profile
@dsoike
dsoike / MyTabBarController.swift
Last active March 7, 2023 07:57
Swift UITabBarController with Custom Transition Animation
import UIKit
class MyTabBarController: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
delegate = self
}
}
//
// InstaStories.swift
// SwiftUITests
//
// Created by Fabio Giolito on 23/06/2019.
// Copyright © 2019 Fabio Giolito. All rights reserved.
//
import Combine
import SwiftUI
@nnsnodnb
nnsnodnb / AnyError.swift
Last active March 17, 2025 12:14
How to upload jpeg image using URLSession.
import Foundation
struct AnyError: Error {
let error: Error
init(_ error: Error) {
self.error = error
}
}
@darrarski
darrarski / FormattedTextField.swift
Last active September 26, 2024 06:33
SwiftUI FormattedTextField - TextField with custom display/edit formatters
import SwiftUI
public struct FormattedTextField<Formatter: TextFieldFormatter>: View {
public init(_ title: String,
value: Binding<Formatter.Value>,
formatter: Formatter) {
self.title = title
self.value = value
self.formatter = formatter
}
import SwiftUI
import WebKit
import PlaygroundSupport
struct ContentView: View {
@State var webView = WebView()
@State var url = ""
var body: some View {
VStack {
@Priva28
Priva28 / GradientEffect.swift
Last active May 6, 2025 06:15
Gradient effect to emulate Apple Music Lyrics/Now Playing screen.
//
// ContentView.swift
// GradientEffect
//
// Created by Christian Privitelli on 18/7/20.
//
import SwiftUI
struct ContentView: View {
@GuyARoss
GuyARoss / main.js
Created August 9, 2020 08:22
stripe noise thing
import {_ as e, L as t} from "./index-4deec983.js";
import {a as n, C as i} from "./Controller-26bd1e9e.js";
import {S as s} from "./ScrollObserver-d0732a2c.js";
import {F as o} from "./index-bee741e4.js";
class r {
constructor(e, t, n, i=!1) {
const s = this
, o = -1 !== document.location.search.toLowerCase().indexOf("debug=webgl");
s.canvas = e,
s.gl = s.canvas.getContext("webgl", {
@kieranb662
kieranb662 / StickyDrag.swift
Created November 2, 2020 03:22
Sticky drag modifier. This modifier adds a drag gesture to the view it modifies. This drag gesture behaves a lot like a rubber band be pulled to its breaking point.
// Swift toolchain version 5.0
// Running macOS version 10.15
// Created on 11/1/20.
//
// Author: Kieran Brown
//
import SwiftUI
import UIKit
import * as React from 'react'
import { SpringValue, easings, useSpring } from 'react-spring'
/**
* Hook that animates height when args.animationKey changes
*
* Ex:
* const animatedBlock = useAnimatedHeight({
* animationKey: key,
* })
@0age
0age / c000r.sol
Last active June 10, 2024 18:32
0xMonaco car (top-ranked finisher by ELO, Paradigm CTF 2022) https://0xmonaco.ctf.paradigm.xyz/viewTeam/OpenSea
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16; // (10M optimization runs)
interface MonacoInterface {
struct CarData {
uint32 balance; // Where 0 means the car has no money.
uint32 speed; // Where 0 means the car isn't moving.
uint32 y; // Where 0 means the car hasn't moved.
Car car;
}