Skip to content

Instantly share code, notes, and snippets.

View fjunior87's full-sized avatar

Francisco Ribeiro Junior fjunior87

View GitHub Profile
@fjunior87
fjunior87 / sampleClass.js
Created March 21, 2011 17:46
Sample Javascript Class
MyClass = function(){
}
var instance = new MyClass();
MyClass = function(){
this.attribute = 'Hello';
}
var instance = new MyClass();
alert(instance.attribute);
MyClass = function(attrValue){
this.attribute = attrValue;
}
var instance = new MyClass("Hello Class");
alert(instance.attribute);
- Criando um objeto
var meuObjeto = {}
- Definindo uma classe
function Pessoa(){
}
- Instanciando uma Pessoa
var p = new Pessoa()
//Criando um objeto
meuObjeto = {}
myObject = new Object()
date = new Date()
array = new Array()
//Definindo uma classe
* Fonte a Jorrar- select * from rss where url='http://fonteajorrar.blogspot.com/feeds/posts/default?alt=rss'
* Biblia Online - select * from html where url="http://www.bibliaonline.com.br/" and xpath='/html/body/p[@class="ot verse" or @class="nt verse"]'
select * from html where url="http://www.bibliaonline.com.br/" and xpath="/html/body/p[@class=\'ot verse\']"
select * from html where url="http://www.bibliaonline.com.br/" and xpath="/html/body/p[@class=\'nt verse\']"
@fjunior87
fjunior87 / remove pyc from git
Created July 22, 2011 19:34
Remove .pyc files from a git project
find . -name "*pyc" -exec git rm -f {} \;
@fjunior87
fjunior87 / CreateSystemUser.java
Created April 25, 2016 01:15
Example of Sling/JackRabbit SystemUser Creation
public void createSystemUser(BundleContext bundleContext) {
ServiceReference SlingRepositoryFactoryReference = bundleContext.getServiceReference(SlingRepository.class.getName());
SlingRepository repository = (SlingRepository)bundleContext.getService(SlingRepositoryFactoryReference);
Session session = null;
try {
session = repository.loginAdministrative(null);
UserManager usrMgr = ((JackrabbitSession)session).getUserManager();
@fjunior87
fjunior87 / CSVReadService.xml
Created July 16, 2016 23:28
Sample Proxy Service that reads a CSV File from file system and parses it using Smooks Mediator
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="CSVReadService" startOnLoad="true" trace="disable"
transports="vfs" xmlns="http://ws.apache.org/ns/synapse">
<target>
<property name="OUT_ONLY" value="true"/>
<inSequence>
<smooks config-key="smooks_conf">
<input type="text"/>
<output type="xml"/>
</smooks>
@fjunior87
fjunior87 / smooks_conf.xml
Created July 16, 2016 23:52
Smooks Config using the CSVParser
<?xml version="1.0" encoding="UTF-8"?>
<localEntry key="smooks_conf" xmlns="http://ws.apache.org/ns/synapse">
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
<!--Configure the CSVParser to parse the message into a stream of SAX events. -->
<resource-config selector="org.xml.sax.driver">
<resource>org.milyn.csv.CSVParser</resource>
<param name="fields" type="string-list">id,name,email,phone</param>
<param name="ident" type="boolean">true</param>
</resource-config>
</smooks-resource-list>