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
PresentationMLPackage presentationMLPackage = | |
(PresentationMLPackage) OpcPackage.load(new java.io.File("src/resources/testPresentation.pptx")); | |
System.out.printf("Slide count: %d", presentationMLPackage.getMainPresentationPart().getSlideCount()); | |
MainPresentationPart mdp = presentationMLPackage.getMainPresentationPart(); | |
String notesFromSlide = mdp.getSlide(0).getNotesSlidePart().getContents().toString(); | |
System.out.printf("Slide 1 notes: %s", notesFromSlide); |
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 time | |
import json | |
import jwt | |
import requests | |
import httplib2 | |
# Project ID for this request. | |
project = 'development-123456' | |
# The name of the zone for this request. |
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
<div class="myAdminForm" access-control permitted-roles="[101]"> | |
...<!-- Secret admin only stuff here! --> | |
</div> |
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
myApp.directive('accessControl', function (userService) { | |
return { | |
restrict: 'A', | |
replace: false, | |
scope: { | |
permittedRoles: '=' | |
}, | |
link: function (scope, element) { | |
var roles = userService.getUserRoles; | |
var matchingRoles = _.intersection(roles, scope.permittedRoles); |
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
it('Should display the right number of elements on the page', function(){ | |
// myExpectedObjects is an array of items i'm expecting to be | |
// drawn on the page | |
var allPromises = myExpectedObjects.map(function(myObject){ | |
return element(by.id(myObject.id)).isPresent(); | |
}); | |
// Wait until all locators have been executed | |
protractor.promise.all(allPromises).then(function(presentValues){ | |
for(var i = 0; i < presentValues.length; i++){ |
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
it('Should display the right number of elements on the page', function(){ | |
// myExpectedObjects is an array of items i'm expecting to be | |
// drawn on the page | |
var elementMissing = false; | |
_.forEach(object in myExpectedObjects, function(myObject){ | |
if(!element(by.id(myObject.id)).isPresent()){ | |
elementMissing = true; | |
} | |
}); |
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
it ('Should check the page title', function (){ | |
browser.get(url); | |
var browserTitle = browser.getTitle(); | |
expect(browserTitle).toEqual('My Title'); | |
}); |
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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://npmjs.org/install.sh | sh |
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
from flask import Flask, render_template, request | |
from twilio.rest import TwilioRestClient | |
app = Flask(__name__) | |
account = "MY_ACCOUNT_SID" | |
token = "MY_ACCOUNT_TOKEN" | |
client = TwilioRestClient(account, token)) | |
@app.route('/') | |
def ReturnForm(): |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<body> | |
<h1>Your message has been sent.</h1> | |
</body> | |
</html> |
NewerOlder