The present gist is a hybrid between a 'go-to' cheat sheet and a tutorial when starting a new Data Science Project.
Its purpose is to create a virtual environment for Python with the package manager Conda.
Table of contents
#This is just a listing of the commands for generating your SSL certificates | |
#Run these commands one at a time from inside your ~/ssl folder | |
#Make sure you create your server.csr.cnf and your v3.ext files first inside the same folder | |
#private key generation | |
#This will ask you for a passphrase(password) do NOT lose this file or the password | |
openssl genrsa -des3 -out ~/ssl/rootCA.key 2048 | |
#create root certificate | |
openssl req -x509 -new -nodes -key ~/ssl/rootCA.key -sha256 -days 1024 -out ~/ssl/rootCA.pem |
openssl genrsa -out CAroot.key 2048 | |
openssl req -new -key CAroot.key -out CAroot.csr # CN should be different from the certificates below | |
openssl req -x509 -days 1825 -key CAroot.key -in CAroot.csr -out CAroot.crt | |
cat CAroot.crt CAroot.key > CAroot.pem | |
openssl genrsa -out mongod.key 2048 | |
openssl req -new -key mongod.key -out mongod.csr | |
openssl x509 -req -days 1825 -in mongod.csr -CA CAroot.pem -CAkey CAroot.key -CAcreateserial -out mongod.crt | |
cat mongod.crt mongod.key > mongod.pem |
<?php | |
######## | |
if (isset($_ENV['PANTHEON_ENVIRONMENT']) && php_sapi_name() != 'cli') { | |
// Redirect to https://$primary_domain in the Live environment | |
if ($_ENV['PANTHEON_ENVIRONMENT'] === 'live' && ($_SERVER['HTTP_HOST'] !== 'live-psea.pantheonsite.io')) { | |
if ($is_www = strpos($_SERVER['HTTP_HOST'], 'www')) { | |
$primary_domain = $_SERVER['HTTP_HOST']; | |
} else |
Development Phase: | |
Step 1: Create Certificate .pem from Certificate .p12 | |
Command: openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12 | |
Step 2: Create Key .pem from Key .p12 | |
Command : openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12 | |
Step 3: Optional (If you want to remove pass phrase asked in second step) | |
Command : openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem |
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:
module.exports = function(grunt) { | |
grunt.initConfig({ | |
settings: { | |
releaseNotes: grunt.option('notes') || 'CI build', | |
appName: 'Flashlight', | |
ppUuid: '0253600x-ac6d-35b6-b66d-dd25c4fd956f', | |
installrAppToken: '6xC0I8SdJA76kW3pqq7GFZLIyq6fBP4Z' | |
}, |
var AudioManager = require("android.media.AudioManager"), | |
MediaPlayer = require('android.media.MediaPlayer'); | |
var audioPlayer = new MediaPlayer(); | |
//mPlayer.prepare(); | |
//audioPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); | |
if (audioPlayer.isPlaying()) { | |
audioPlayer.reset(); | |
} | |
audioPlayer.setDataSource('http://revelbeats.com/assets/audio/Salsa/DJ_Johnny_Famolari_Jailmix_salsa.mp3'); |
var FBSDKShareLinkContent = require("FBSDKShareKit/FBSDKShareLinkContent"), | |
FBSDKShareDialog = require("FBSDKShareKit/FBSDKShareDialog"), | |
NSURL = require("Foundation/NSURL"); | |
var win = Ti.UI.createWindow({ | |
backgroundColor: "#fff" | |
}); | |
var btn = Ti.UI.createButton({ | |
title: "Trigger Share Dialog" |
const SFAuthenticationSession = require('SafariServices/SFAuthenticationSession'); | |
const NSURL = require('Foundation/NSURL'); | |
const session = SFAuthenticationSession.alloc().initWithURLCallbackURLSchemeCompletionHandler( | |
NSURL.alloc().initWithString('https://github.com/login/oauth/authorize?scope=repo&client_id=XXXXX'), | |
'appcgithub://', | |
function(url, error) { | |
if (error != null) { | |
Ti.API.error('Error performing OAuth: ' + error.localizedDescription); | |
cb({ success: false, error: 'Error performing OAuth: ' + error.localizedDescription }); |