Skip to content

Instantly share code, notes, and snippets.

View douglaszaltron's full-sized avatar
👨‍💻
Focusing

Douglas Zaltron douglaszaltron

👨‍💻
Focusing
View GitHub Profile
{
"extends": [
"@softboxlab/eslint-config-gandalf-lint-react"
],
"rules": {
"import/order": [
"error",
{
"groups": [
"builtin",
const models = require('../app/models')
const Sequelize = require('sequelize')
const fs = require('fs')
const path = require('path')
const sequelize = new Sequelize('', '', '', {
host: '',
dialect: 'postgres'
})
@douglaszaltron
douglaszaltron / thinced.js
Created August 31, 2018 20:14 — forked from varmais/thinced.js
Geolocation to Promise wrap example
var getPosition = function (options) {
return new Promise(function (resolve, reject) {
navigator.geolocation.getCurrentPosition(resolve, reject, options);
});
}
getPosition()
.then((position) => {
console.log(position);
})
import Foundation
open class SnackbarView: UIView {
internal let snackRemoval: Notification.Name = Notification.Name(rawValue: "snackbar.removalNotification")
// MARK: Properties
/// The controller for this view
internal var controller: CAPSnackbarPlugin?
import Foundation
/**
* Implement three common modal types: alert, confirm, and prompt
*/
@objc(CAPModalsPlugin)
public class CAPModalsPlugin : CAPPlugin {
@objc public func alert(_ call: CAPPluginCall) {
guard let title = call.options["title"] as? String else {
import Foundation
import Photos
enum CameraSource: String {
case prompt = "PROMPT"
case camera = "CAMERA"
case photos = "PHOTOS"
}
enum CameraResultType: String {
import Foundation
public struct UIKitLocalizedString {
public static func forKey(_ key: String) -> String {
guard let bundle = Bundle(identifier: "com.apple.UIKit") else { return key}
let localizedString = bundle.localizedString(forKey: key, value: nil, table: nil)
function loading(promise) {
ctrl.submitting = true;
$ionicLoading.show();
return promise.finally(function onFinally() {
ctrl.submitting = false;
$ionicLoading.hide();
});
}