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
javascript: (function() { | |
var root = $(document.getElementsByTagName('html')); | |
var watchers = []; | |
var attributes = []; | |
var attributes_with_values = []; | |
var elements = []; | |
var elements_per_attr = []; | |
var scopes = []; |
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
-- ExportSQLite: SQLite export plugin for MySQL Workbench | |
-- Copyright (C) 2009 Thomas Henlich | |
-- | |
-- This program is free software: you can redistribute it and/or modify | |
-- it under the terms of the GNU General Public License as published by | |
-- the Free Software Foundation, either version 3 of the License, or | |
-- (at your option) any later version. | |
-- | |
-- This program is distributed in the hope that it will be useful, | |
-- but WITHOUT ANY WARRANTY; without even the implied warranty of |
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 React, {useState, useEffect} from 'react'; | |
import { | |
SafeAreaView, | |
Text, | |
View, | |
TextInput, | |
StatusBar, | |
ActivityIndicator, | |
} from 'react-native'; | |
import Svg, {Circle} from 'react-native-svg'; |
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
let emitterLayer = CAEmitterLayer() | |
emitterLayer.frame = navigationView.bounds | |
emitterLayer.renderMode = .additive | |
emitterLayer.emitterMode = .outline | |
emitterLayer.emitterShape = .line | |
emitterLayer.emitterSize = CGSize(width: 50, height: 0) | |
emitterLayer.emitterPosition = CGPoint(x: navigationView.bounds.width / 2, y: navigationView.bounds.height) | |
emitterLayer.velocity = 1 | |
emitterLayer.seed = (arc4random() % 100) + 1 | |
navigationView.layer.insertSublayer(emitterLayer, at: 0) |
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 React from 'react'; | |
import {View, SafeAreaView, StyleSheet, ScrollView} from 'react-native'; | |
import Svg, {Defs, LinearGradient, Stop, Rect} from 'react-native-svg'; | |
import {MotiView} from 'moti'; | |
const Gradient = () => ( | |
<Svg viewBox="0 0 100 100"> | |
<Defs> | |
<LinearGradient id={'gradient'} x1={'0%'} y1={'0%'} x2={'100%'} y2={'0%'}> | |
<Stop stopOpacity={0} stopColor={'rgb(225, 225, 225)'} offset={'0%'} /> |
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 UIKit | |
extension Array where Element == NSLayoutConstraint { | |
/// Activates each constraint in an array of `NSLayoutConstraint`. | |
/// | |
/// Example usage: `[view.heightAnchor.constraint(equalToConstant: 30), view.widthAnchor.constraint(equalToConstant: 30)].activate()` | |
func activate() { | |
NSLayoutConstraint.activate(self) | |
} |
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 { Dimensions } from 'react-native'; | |
const { height: screenHeight, width: screenWidth } = Dimensions.get('window'); | |
const EACH_HEIGHT_UNIT = screenHeight / 100 | |
const EACH_WIDTH_UNIT = screenWidth / 100 | |
/** | |
* device height percentage | |
*/ |
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 UIKit | |
class ViewController: UIViewController { | |
let textViewWrapper = TextViewWrapper() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// The problem view! I want to add this one to my set of Auto Layout constraints, | |
// even though it's not using Auto Layout internally. |
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
// Declaring ContainerView as a HOC | |
struct ContainerView<C: View> : View { | |
let childView: C | |
init(_ childView: () -> (C)) { | |
self.childView = childView() | |
} | |
var body: some View { | |
childView |
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 Error { | |
var code: Int { return (self as NSError).code } | |
var domain: String { return (self as NSError).domain } | |
var userInfo: [String:Any] { return (self as NSError).userInfo } | |
func timeAfterWhichToRetry(retryCount: Int) -> TimeInterval? { | |
// CloudKit suggests us retry too often, so slow us down as we retry a lot, up to 5 minutes | |
if let suggestedTimeout = suggestedTimeAfterWhichToRetry { | |
if suggestedTimeAfterWhichToRetry == 0 { | |
return 0 |
OlderNewer