Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
| /* | |
| * Copyright (c) 2017 Halcyon Mobile | |
| * http://www.halcyonmobile.com | |
| * All rights reserved. | |
| */ | |
| import android.databinding.DataBindingUtil | |
| import android.databinding.OnRebindCallback | |
| import android.databinding.ViewDataBinding | |
| import android.support.annotation.CallSuper | |
| import android.support.annotation.LayoutRes |
| private val callback = object : RoomDatabase.Callback() { | |
| override fun onCreate(db: SupportSQLiteDatabase) { | |
| try { | |
| // First time to database was created, check if user upgraded from a previous | |
| // version of the app that was using ORMLite and migrate data if needed. | |
| val context = TradeMeApp.getContext() | |
| val previousDB = context.applicationContext.getDatabasePath(PREVIOUS_DATABASE_FILE) | |
| if (previousDB.exists()) { | |
| MigrateToRoom(previousDB, context.component.database).execute() | |
| } |
| /* | |
| * Copyright (C) 2017 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 | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| // //////////////////////////////// | |
| // How to use? | |
| // 1. Make sure you've ran the `sequelize init` before (It should create `config`,`seeders`,`migrations` folders). | |
| // 2. Run it with `node sequelize-schema-file-generator.js` | |
| // 3. Review the generated migrations inside of the `migrations` folder. | |
| // //////////////////////////////// | |
| /* jscs:disable */ | |
| /* jshint ignore:start */ | |
| var path = require('path') |
| package com.your.package | |
| import android.app.Dialog | |
| import android.os.Bundle | |
| import com.your.package.R | |
| import com.google.android.material.bottomsheet.BottomSheetDialog | |
| import com.google.android.material.bottomsheet.BottomSheetDialogFragment | |
| /** | |
| * BottomSheetDialog fragment that uses a custom |
Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
| // | |
| // UIView+Extensions.swift | |
| // | |
| // Created by Luis Ramos on 17/5/18. | |
| // | |
| import UIKit | |
| extension UIView { | |
| fun <T> backoff(times: Int = Int.MAX_VALUE, predicate: (Throwable, Int) -> Boolean = { _, _ -> true }): ObservableTransformer<T, T> { | |
| return ObservableTransformer { | |
| it.retryWhen { attempts -> | |
| val counter = AtomicInteger() | |
| attempts.takeWhile { e -> counter.getAndIncrement() < times && predicate(e, counter.get()) } | |
| .flatMap { Observable.timer(counter.get().toLong(), TimeUnit.SECONDS) } | |
| } | |
| } | |
| } |
| <?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="..."> | |
| <uses-permission android:name="android.permission.INTERNET" /> | |
| <application | |
| android:name="..." |
| # vim:ft=zsh ts=2 sw=2 sts=2 | |
| # | |
| # agnoster's Theme - https://gist.github.com/3712874 | |
| # A Powerline-inspired theme for ZSH | |
| # | |
| # # README | |
| # | |
| # In order for this theme to render correctly, you will need a | |
| # [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts). | |
| # Make sure you have a recent version: the code points that Powerline |