Skip to content

Instantly share code, notes, and snippets.

View fiorenzino's full-sized avatar
🏠
Working from home

fiorenzo pizza fiorenzino

🏠
Working from home
View GitHub Profile

GitHub Flavored Markdown

View the source of this content.

Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character:

Roses are red Violets are blue

@fiorenzino
fiorenzino / post_deploy
Created June 6, 2013 13:38
post_deploy
#!/bin/bash
# This is a simple post deploy hook executed after your application
# is deployed and started. This script gets executed directly, so
# it could be python, php, ruby, etc.
echo "*************************POST DEPLOY START*********************************"
if [ ! -d "$OPENSHIFT_DATA_DIR/errors" ]; then
mkdir $OPENSHIFT_DATA_DIR/errors
echo "CREATED OPENSHIFT_DATA_DIR - ERRORS"
fi
ln -s $OPENSHIFT_DATA_DIR/errors $OPENSHIFT_JBOSSAS_DIR/standalone/deployments/ROOT.war/errors
@fiorenzino
fiorenzino / licence.java
Created May 27, 2013 12:42
licence.java
/*
* Copyright 2013 twiliofaces.org.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
/*
* Copyright 2013 twiliofaces.org.
*
* Licensed under the Eclipse Public License version 1.0, available at
package org.twiliofaces.test;
import java.util.HashMap;
import java.util.Map;
import junit.framework.Assert;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.resteasy.client.ClientResponse;
public static boolean validateAgainstXSD(String xml, String xsd) {
InputStream xmlIs = new ByteArrayInputStream(xml.getBytes());
InputStream xsdIs = new ByteArrayInputStream(xsd.getBytes());
return validateAgainstXSD(xmlIs, xsdIs);
}
public static boolean validateAgainstXSD(InputStream xml, InputStream xsd) {
try {
SchemaFactory factory = SchemaFactory
.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
String smsId = twilioSmsSender.setAccountSid(smsToSend.getAccountSid())
.setAuthToken(smsToSend.getTwilioToken())
.setFrom(smsToSend.getFrom()).setTo(smsToSend.getTo())
.setBody(smsToSend.getText()).send();
String callId = twilioCaller.setAccountSid(callToMake.getAccountSid())
.setAuthToken(callToMake.getTwilioToken())
.setFrom(callToMake.getFrom()).setTo(callToMake.getTo())
.setEndpoint(callToMake.getUrl()).call();
package org.twiliofaces.test.twilioscope;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
import org.twiliofaces.annotations.configuration.TwilioClientToken;
@RequestScoped
@Named
package org.twiliofaces.test.twilioscope;
import java.io.Serializable;
import java.util.Date;
import javax.inject.Inject;
import javax.inject.Named;
import org.twiliofaces.annotations.TwilioScope;
import org.twiliofaces.annotations.notification.CallSid;
<?xml version="1.0" encoding="UTF-8"?>
<f:view xmlns="http://www.w3c.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:tf="http://twiliofaces.org/twiliofaces">
<tf:response>
<tf:say>Our store is located at 123 Easy St.</tf:say>
<tf:sms action="/smsHandler.php" method="POST">Store Location: 123 Easy St.</tf:sms>
</tf:response>
</f:view>