Skip to content

Instantly share code, notes, and snippets.

View ahmadrosid's full-sized avatar
🚀
On

ahmadrosid ahmadrosid

🚀
On
View GitHub Profile
@lukepistrol
lukepistrol / TaskTrigger.swift
Last active November 19, 2023 19:32
Attach async tasks to SwiftUI views using a trigger mechanism.
import SwiftUI
struct TaskTrigger<T: Equatable>: Equatable {
fileprivate enum TaskState<S: Equatable>: Equatable {
case inactive
case active(value: S, uniqueId: UUID? = nil)
}
fileprivate var state: TaskState<T> = .inactive
@nl5887
nl5887 / convert.bash
Last active November 9, 2021 13:11
Quicktime to Animated gif using FFMPEG
#!/bin/bash
# convert to gif (improved palette) and 5 second still at the end
ffmpeg -i sans.mov -filter_complex "fps=25,setpts=PTS/5,split[v1][v2]; [v1]palettegen=stats_mode=full,tpad=stop_mode=clone:stop_duration=5 [palette];[v2][palette]paletteuse=dither=sierra2_4a" -loop 0 sans4.gif
@zserge
zserge / Add.java
Last active November 22, 2021 11:16
A tiny JVM to run a single method from a single class
public class Add {
public static int add(int a, int b) {
return a + b;
}
}
@maephisto
maephisto / Javascript ISO country code to country name conversion
Last active November 3, 2023 21:05
ISO 3166-1 alpha-2 country code to country name conversion with a simple Javascript implementation, an array and a function.
var isoCountries = {
'AF' : 'Afghanistan',
'AX' : 'Aland Islands',
'AL' : 'Albania',
'DZ' : 'Algeria',
'AS' : 'American Samoa',
'AD' : 'Andorra',
'AO' : 'Angola',
'AI' : 'Anguilla',
'AQ' : 'Antarctica',
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p
#EXTINF:-1,BBC - Radio 2
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p
#EXTINF:-1,BBC - Radio 3
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-aac-lc-a/format/pls/vpid/bbc_radio_three.pls
#EXTINF:-1,BBC - Radio 4
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p
#EXTINF:-1,BBC - Radio 5 live