Skip to content

Instantly share code, notes, and snippets.

try:
URL = "https://data.gov.il/api/3/action/datastore_search?resource_id=c8b9f9c8-4612-4068-934f-d4acd2e3c06e"
plate_filled = plate.zfill(8)
dictionary = {
"MISPAR RECHEV": plate_filled
}
json_object = json.dumps(dictionary, indent=4)
PARAMS = {'filters': json_object}
@liorazi
liorazi / 1.txt
Created April 8, 2020 06:24
LA-Links
לבריאות או לבריאות
https://www.youtube.com/watch?v=rnc4ReF3Y3E
מה נשתנה או מה השתנה
https://hebrew-academy.org.il/2018/07/24/%D7%94%D7%AA%D7%91%D7%A7%D7%A9%D7%A0%D7%95-%D7%90%D7%95-%D7%A0%D7%AA%D7%91%D7%A7%D7%A9%D7%A0%D7%95-%D7%A2%D7%9C-%D7%94%D7%AA%D7%A4%D7%A2%D7%9C-%D7%95%D7%A0%D7%AA%D7%A4%D7%A2%D7%9C/
מלל
https://static.wixstatic.com/media/a4557f_3603fa0b100848c6893602483f0d4fee~mv2.png/v1/fill/w_1580,h_1142,al_c/a4557f_3603fa0b100848c6893602483f0d4fee~mv2.png
@liorazi
liorazi / Animation+CustomTimingFunctions.swift
Last active February 7, 2024 01:01
Extension to SwiftUI Animation which extends it with more ease timing functions as described in: https://easings.net
import SwiftUI
extension Animation {
public static func easeInSin(duration: Double) -> Animation {
return self.timingCurve(0.47, 0, 0.745, 0.715, duration: duration)
}
public static var easeInSin: Animation = Animation.timingCurve(0.47, 0, 0.745, 0.715)
@liorazi
liorazi / LiveView.swift
Created June 11, 2019 19:39
SwiftUI monospaced example
import PlaygroundSupport
import SwiftUI
struct LiveView: View {
var body: some View {
VStack(alignment: .leading) {
Text("Hello World 999")
.font(.system(.title, design: .monospaced))
Text("Hello World 111")
.font(.system(.title, design: .monospaced))
@liorazi
liorazi / bug.swift
Last active November 23, 2018 15:19
Possible compiler bug in Swift 4.2
func foo(_ boo: String) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
self.goo()
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { //Swift 4.2 Compiler Error: Cannot invoke 'asyncAfter' with an argument list of type '(deadline: DispatchTime, @convention(block) ()
self.bar(nil)
}
}
}
func bar(_ sender:Any) {
@liorazi
liorazi / gist:44860af71f1799adf981146c8392b34c
Created February 11, 2018 15:37
Set System Font To Have Monospaced Digits
myLabel.font = UIFont.monospacedDigitSystemFont(ofSize: 42.0, weight: UIFontWeightMedium)
@liorazi
liorazi / Font+MonospacedDigits.swift
Created February 11, 2018 15:19
Font Extension for Monospaced Digits (Swift 4.0)
import UIKit
extension UIFont {
var monospacedDigitFont: UIFont {
let oldFontDescriptor = fontDescriptor
let newFontDescriptor = oldFontDescriptor.monospacedDigitFontDescriptor
return UIFont(descriptor: newFontDescriptor, size: 0)
}
@liorazi
liorazi / gist:d16795ecbecd8e60bba0aeda5d8b7805
Created June 1, 2016 08:57
Observing AVAudioSession Interruptions
- (void)addInterruptionNotification {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleInterruption:) name:@"AVAudioSessionInterruptionNotification" object:nil];
}
- (void)handleInterruption:(NSNotification *) notification{
if (notification.name != AVAudioSessionInterruptionNotification || notification.userInfo == nil) {
return;
}
NSDictionary *info = notification.userInfo;