Example use case:
class User < ApplicationRecord
belongs_to :authable, polymorphic: true, optional: true
end
class Google < ApplicationRecord| const { execSync } = require("child_process"); | |
| const fs = require("fs"); | |
| const packagesToCheck = [ | |
| "backslash", | |
| "chalk", | |
| "chalk-template", | |
| "color-convert", | |
| "color-name", | |
| "color-string", |
| import { render } from 'react-dom' | |
| import React, { useState } from 'react' | |
| import { useSprings, animated } from 'react-spring' | |
| const items = ['hey', 'yooo'] | |
| function ReactSpringExample() { | |
| const [pos, setPos] = useState(0) | |
| const springs = useSprings(items.length, items.map((item, i) => ({ | |
| opacity: pos === i ? 1 : 0, |
| import android.app.Activity; | |
| import androidx.lifecycle.Lifecycle; | |
| import androidx.lifecycle.LifecycleObserver; | |
| import androidx.lifecycle.OnLifecycleEvent; | |
| import java.lang.ref.WeakReference; | |
| import java.util.function.Consumer; | |
| public class ActivityLifecycleListener implements LifecycleObserver { |
| /* | |
| implementation 'androidx.viewpager2:viewpager2:1.1.0-alpha01' | |
| implementation 'com.google.android.material:material:1.1.0-alpha08' | |
| */ | |
| public class MultipleTurbolinksViewActivity extends BaseActivity { | |
| private ActivityMultipleTurbolinksViewBinding binding; | |
| private String[] paths = new String[]{"/", "/profile"}; |
| require "colorize" | |
| arr_loading = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"] | |
| i = 0 | |
| loop do | |
| print "#{arr_loading[i % arr_loading.size]}\r".colorize(:light_magenta) | |
| i += 1 | |
| sleep(0.1) | |
| end |
| <?xml version="1.0" encoding="utf-8"?> | |
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| package="com.example.example"> | |
| <!-- ... --> | |
| <application | |
| <!-- ... --> > | |
| <!-- ... --> |
| <androidx.appcompat.widget.AppCompatEditText | |
| android:background="@null" | |
| android:inputType="none" | |
| android:textIsSelectable="false" | |
| android:cursorVisible="false" | |
| android:focusable="false" | |
| android:layout_width="200dp" | |
| app:layout_constrainedWidth="true" | |
| android:scrollHorizontally="true" | |
| android:singleLine="true" |
| public final class RxBus { | |
| // String can be replaced with any kind of Object. | |
| private static final BehaviorSubject<String> behaviorSubject | |
| = BehaviorSubject.create(); | |
| public static Disposable subscribe(@NonNull Consumer<String> action) { | |
| return behaviorSubject.subscribe(action); | |
| } | |
| public static void publish(@NonNull String value) { |