For example, you want to set 40% alpha transparence to #000000
(black color), you need to add 66
like this #66000000
.
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
#!/bin/sh | |
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal | |
# make sure the output directory exists | |
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" | |
# Step 1. Build Device and Simulator versions | |
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build | |
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build |
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
NSURLConnection | NSURLSession | |
------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------- | |
NSURLConnectionDelegate connectionShouldUseCredentialStorage: | | |
------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------- | |
NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler: | |
| N |
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
struct SecCertificateWrapper : Comparable { | |
var data:Data | |
var cert:SecCertificate | |
// Initialize with a data object from the "DeveloperCertificates" | |
// array (see WrapperImplementation.swift) | |
init(data:Data) { | |
self.cert = SecCertificateCreateWithData(nil, data as CFData)! | |
// Use this later for parsing the date details from the cert |
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
/** | |
* MongoDB NodeJS Driver Production Connection Example | |
* | |
* Copyright (c) 2015 ObjectLabs Corporation | |
* Distributed under the MIT license - http://opensource.org/licenses/MIT | |
*/ | |
var MongoClient = require('mongodb').MongoClient; | |
/** |
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
'use strict'; | |
const execSync = require('child_process').execSync; | |
const json = JSON.parse(execSync('xcrun simctl list --json')); | |
for (const runtime of Object.keys(json.devices)) { | |
for (const device of json.devices[runtime]) { | |
console.log(`Removing ${device.name} (${device.udid})`); | |
execSync(`xcrun simctl delete ${device.udid}`); | |
} |
With Alloy and Hyperloop, you can quickly and easily expose native UI as Custom Alloy tags by leveraging the namespace (ns) attribute and commonjs modules.
Alloy allows you to create your own UI element that can be included into the XML View heirarchy in one of two ways, an Alloy Widget or through the use of Custom Tags.
To create your own custom tag, you link the tag to the commonjs module with the namespace attribute (ns). Here is an example using a custom tag to render a standard Titanium View:
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 mongoose from 'mongoose'; | |
let schema = new mongoose.Schema({ | |
email: { type: String, required: true, unique: true }, | |
password: { type: String, required: true } | |
}); | |
schema.statics.findOrCreate = async (conditions, opt_attr) => { | |
let document = await User.findOne(conditions); |
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
var win = Ti.UI.createWindow({ | |
backgroundColor: 'white', | |
top: 0, left: 0, right: 0, bottom: 0, | |
layout: "vertical" | |
}); | |
var button = Ti.UI.createButton({ | |
title: "click me" | |
}); | |
win.add(button); |
NewerOlder