This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
import SwiftUI | |
public extension View { | |
func bindWindow(_ window: Binding<NSWindow?>) -> some View { | |
return background(WindowAccessor(window)) | |
} | |
} | |
public struct WindowAccessor: NSViewRepresentable { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
extension Calendar { | |
func generateDates( | |
inside interval: DateInterval, | |
matching components: DateComponents | |
) -> [Date] { | |
var dates: [Date] = [] | |
dates.append(interval.start) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ruby on Rails Deployment Image | |
# | |
# Builds a ready to be deployed image of a Ruby on Rails application. | |
# https://ebababi.net/dockerfile-for-ruby-on-rails-deployments.html | |
# Copyright (C) 2019 Nikolaos Anastopoulos, Inc. All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions | |
# are met: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Applies window transformation flags (WTFs) to aid in supporting | |
* edge-to-edge layouts on Android Q and higher. | |
*/ | |
fun Activity?.applyEdgeToEdge( | |
lightStatusBar: Boolean = false, | |
lightNavigationBar: Boolean = false, | |
transparentStatusBar: Boolean = true, | |
immersive: Boolean = false | |
) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension XCTestCase { | |
struct AwaitError: Error {} | |
/** | |
This function is useful for asynchronous testing and acts as a wrapper around test expectations. | |
Consider the following example: | |
```swift | |
// Let's asume we have an async function with the following signature: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2019 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* https://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This example using | |
# Nim: 0.18.0 | |
# Jester: 0.2.1 | |
# Using Jester >= 0.3.0 is preferrable if your Nim version > 0.18.0 | |
# In case you're using Jester >= 0.3.0, look the syntax different | |
# in its example because it's not backward compatible | |
import db_sqlite, asyncdispatch, json, strformat, strutils, sequtils | |
import jester |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Navigator | |
const SettingsScreen = createLazyComponent( | |
() => require('../containers/component').default | |
); | |
// ... | |
const MainStackNavigator = StackNavigator( | |
{ | |
SettingsScreen: { | |
screen: SettingsScreen, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import patty | |
import strformat | |
import strutils | |
import sugar | |
include karax / prelude | |
include karax / kdom | |
include karax / kajax | |
type |
NewerOlder