Skip to content

Instantly share code, notes, and snippets.

@frankfka
frankfka / iOSCustomSegmentedControlSwiftUI.swift
Created May 17, 2020 16:47
Custom Segmented Picker / Segmented Control in SwiftUI
import SwiftUI
extension View {
func eraseToAnyView() -> AnyView {
AnyView(self)
}
}
struct SizePreferenceKey: PreferenceKey {
typealias Value = CGSize
@IanColdwater
IanColdwater / twittermute.txt
Last active July 2, 2024 02:25
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@tobydeh
tobydeh / docker-compose.yml
Last active October 23, 2022 20:51
gitea 1.10, drone 1.6 and drone-runner-docker example using docker-compose
# Instructions
# 1. Update your /etc/hosts file...
# > 127.0.0.1 gitea drone
# 2. Run gitea + gitea-db and generate the oauth application
# > docker-compose -p gitea-drone up gitea gitea-db
# - Navigate to http://gitea:3000 to finish the installation and register a user
# - Create a oauth application as described here: https://docs.drone.io/installation/providers/gitea/
# - Set the Redirect uri to http://drone:8000/login
# 3. Update the docker-compose file with the client_id and client_secret
# 4. Fire up all of the services
@alsyundawy
alsyundawy / freshclam.conf
Last active April 7, 2024 23:45
ClamAV Unofficial Sign Database Repository
# Custom Database Clamav With token (register for free https://www.securiteinfo.com/clients/customers/account )
DatabaseCustomURL https://www.securiteinfo.com/get/signatures/7e7af83dd8eb714f77d6ddb08932b66c5e3779c805e52dec70df86995c55e040e5ebe37b01edb1bfcf538bf39e3e0d61dfd5f2b086694fae2866500a37a504be/securiteinfo.hdb
DatabaseCustomURL https://www.securiteinfo.com/get/signatures/7e7af83dd8eb714f77d6ddb08932b66c5e3779c805e52dec70df86995c55e040e5ebe37b01edb1bfcf538bf39e3e0d61dfd5f2b086694fae2866500a37a504be/securiteinfo.ign2
DatabaseCustomURL https://www.securiteinfo.com/get/signatures/7e7af83dd8eb714f77d6ddb08932b66c5e3779c805e52dec70df86995c55e040e5ebe37b01edb1bfcf538bf39e3e0d61dfd5f2b086694fae2866500a37a504be/javascript.ndb
DatabaseCustomURL https://www.securiteinfo.com/get/signatures/7e7af83dd8eb714f77d6ddb08932b66c5e3779c805e52dec70df86995c55e040e5ebe37b01edb1bfcf538bf39e3e0d61dfd5f2b086694fae2866500a37a504be/spam_marketing.ndb
DatabaseCustomURL https://www.securiteinfo.com/get/signatures/7e7af83dd8eb714f
@bradtraversy
bradtraversy / docker_wordpress.md
Last active July 21, 2024 05:00
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@asoorm
asoorm / docker-compose-mongo-replicaset.yml
Created September 14, 2018 19:00
Mongo Replica Set docker compose
version: "3"
services:
mongo1:
hostname: mongo1
container_name: localmongo1
image: mongo:4.0-xenial
expose:
- 27017
ports:
- 27011:27017
@eugenebokhan
eugenebokhan / CGImage+Resize.swift
Last active April 11, 2024 21:28
UIImage + Resize
import CoreGraphics
import Accelerate
import CoreImage
import UIKit
extension CGImage {
public enum Error: Swift.Error {
case imageResizingFailed
case cgContextCreationFailed
@takahirom
takahirom / EventBus.kt
Last active June 8, 2024 14:09
EventBus by Kotlin coroutine
import kotlinx.coroutines.experimental.channels.BroadcastChannel
import kotlinx.coroutines.experimental.channels.ConflatedBroadcastChannel
import kotlinx.coroutines.experimental.channels.ReceiveChannel
import kotlinx.coroutines.experimental.channels.filter
import kotlinx.coroutines.experimental.channels.map
import kotlinx.coroutines.experimental.launch
import javax.inject.Inject
import javax.inject.Singleton
@htmlpluscss
htmlpluscss / polyfill.js
Created December 6, 2017 06:02 — forked from nekman/polyfill.js
polyfill.io IE11
/* Polyfill service v3.16.0
* For detailed credits and licence information see https://github.com/financial-times/polyfill-service.
*
* UA detected: ie/11.0.0
* Features requested: default
*
* - Array.from, License: CC0 (required by "default")
* - Array.of, License: MIT (required by "default")
* - Array.prototype.fill, License: CC0 (required by "default")
* - Event, License: CC0 (required by "default", "CustomEvent", "Promise")
@arkilis
arkilis / get_google_map.kt
Created November 30, 2017 06:25
Get location from google map on kotlin
// 1.
class LocationActivity : AppCompatActivity(), OnMapReadyCallback {
// 2.
private var mLocationRequest: LocationRequest? = null
private val UPDATE_INTERVAL = (10 * 1000).toLong() /* 10 secs */
private val FASTEST_INTERVAL: Long = 2000 /* 2 sec */
private var latitude = 0.0
private var longitude = 0.0