This file contains hidden or 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 | |
| struct ContentView: View { | |
| @State private var moveGradient = true | |
| var body: some View { | |
| slideToPowerOffText(text: "Slide to power off", textColor: .black) | |
| } |
This file contains hidden or 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 | |
| let ratings = [4, 8, 9.5, 2,6, 7, 3.5, 5.9, 1.5, 3.3, 9] | |
| let results = ratings.reduce(into [:]) { (results: inout [String: Int], rating: Double) in | |
| switch rating { | |
| case 1..<4: results["Very bad", default: 0] += 1 | |
| case 4..<6: results["Ok", default: 0] += 1 | |
| case 6..<8: results["Good bad", default: 0] += 1 |
This file contains hidden or 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 | |
| let urlImages = ["https://applecoding.com/wp-content/uploads/2019/07/cropped-black-and-white-black-and-white-challenge-262488-1024x576.jpg", | |
| "https://applecoding.com/wp-content/uploads/2019/07/cropped-company-concept-creative-7369-1-1024x575.jpg", | |
| "https://applecoding.com/wp-content/uploads/2018/06/cropped-mapkitjs-portada-1024x576.jpg", | |
| "https://applecoding.com/wp-content/uploads/2019/06/combine-operators-1024x573-1024x576.jpg", | |
| "https://applecoding.com/wp-content/uploads/2019/06/wwdc_2_0.jpg", | |
| "https://applecoding.com/wp-content/uploads/2018/06/header-390x220.jpg", | |
| "https://applecoding.com/wp-content/uploads/2018/06/mapkitjs-portada-1024x576.jpg"] |
This file contains hidden or 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
| // Set blur gaussian effect to a UIView | |
| let visualEffectView = UIVisualEffectView(effect: nil) | |
| let totalContainerView = UIView() | |
| let animator = UIViewPropertyAnimator(duration: 0.5, curve: .linear) | |
| self.view.setBlurEffectGeneral(mainView: self.view, | |
| animator: animator, | |
| totalContainer: totalContainerView, | |
| visualEffect: visualEffectView) |
This file contains hidden or 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
| //decimal | |
| let decimalNumber = 17 | |
| //Binario | |
| let decimalBinario = 0b10001 // 16*1 + 8*0 + 4*0 + 2*2 + 1*1 + = 17 Binario | |
| //Octal | |
| let decimalOctal = 0o21 //8*2 + 1*1 | |
| //hexadecimal | |
| let decimalHexa = 0x11 //16*1+1 | |
| let number = 1.25e2 //1.25*10^2 |
This file contains hidden or 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
| // | |
| // LocalNotificationsController.swift | |
| // | |
| import Foundation | |
| import UserNotifications | |
| class LocalNotificationsController { | |
| init() { | |
| let center = UNUserNotificationCenter.current() |
This file contains hidden or 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 {Platform, View, Linking,} from 'react-native'; | |
| export default class deepLinkRN extends React.Component { | |
| constructor(props){ | |
| super(props) | |
| this.state = { } | |
| } |
This file contains hidden or 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
| /*--------- variable ----------*/ | |
| this.state={varScroll:false} | |
| /*-------- Functions ----------*/ | |
| setvarScrollState() { | |
| this.setState({VarScroll: true}); | |
| } |
This file contains hidden or 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
| RewriteEngine On | |
| Options +FollowSymLinks | |
| #Allow '-' and letters/numbers | |
| RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9-]+)$ b_user.php?view=$1&name=$2 | |
| RewriteRule ^([a-zA-Z0-9]+)$ b_user.php?view=$1 | |
| RewriteRule ^([^\.]+)$ $1.php [NC,L] |
This file contains hidden or 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
| jQuery.validator.addMethod("nameRegex", function(value, element) { | |
| return this.optional(element) || /^[a-z\ \s]+$/i.test(value); | |
| }, "Name must contain only letters & space"); | |
| jQuery("#empform").validate({ | |
| rules :{ | |
| 'name':{ | |
| required:true, | |
| nameRegex:true |
NewerOlder