Skip to content

Instantly share code, notes, and snippets.

View olopsman's full-sized avatar

Paulo Orquillo olopsman

View GitHub Profile
@olopsman
olopsman / import.js
Created August 26, 2020 04:08
lwc-api
import {LightningElement, api} from 'lwc';
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
//
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
//
}
//
// SceneDelegate.swift
// Cash Goals
//
// Created by Paulo Orquillo on 25/07/20.
// Copyright © 2020 Paulo Orquilo. All rights reserved.
//
import UIKit
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let storyboard = UIStoryboard(name: "Main", bundle: nil)
var vc : UIViewController = storyboard.instantiateViewController(withIdentifier: "mainScreen") as UIViewController
window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = vc
self.window?.makeKeyAndVisible()
return true
}
function wp_maintenance_mode() {
if (!current_user_can('edit_themes') || !is_user_logged_in()) {
wp_die('<h1>Under Maintenance</h1><br />Website under planned maintenance. Please check back later.');
}
}
add_action('get_header', 'wp_maintenance_mode');
p.then($A.getCallback(function(response) {
//do something
console.log('success response ' + response);
return 'success';
}).then(function(message){
if(message == 'success'){
// do something
console.log('message: ' + message);
}
}).catch(function(error){
var p = helper.apexPromise(component,'c.updateAccount',
{
accountId : component.get("v.recordId")
});
apexPromise : function(component, methodName, params) {
return new Promise($A.getCallback(function(resolve, reject) {
var action = component.get(methodName);
action.setParams(params);
action.setCallback(self, function(res) {
var state = res.getState();
if(state === 'SUCCESS') {
resolve(res.getReturnValue());
} else if(state === 'ERROR') {
reject(action.getError())
new Date().toISOString().slice(0, 10); // output 2020-06-22 eg.
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
pull_request:
branches: [ staging ]