Skip to content

Instantly share code, notes, and snippets.

View fjunior87's full-sized avatar

Francisco Ribeiro Junior fjunior87

View GitHub Profile
@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 / remove pyc from git
Created July 22, 2011 19:34
Remove .pyc files from a git project
find . -name "*pyc" -exec git rm -f {} \;
* 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\']"
//Criando um objeto
meuObjeto = {}
myObject = new Object()
date = new Date()
array = new Array()
//Definindo uma classe
- Criando um objeto
var meuObjeto = {}
- Definindo uma classe
function Pessoa(){
}
- Instanciando uma Pessoa
var p = new Pessoa()
MyClass = function(attrValue){
this.attribute = attrValue;
}
var instance = new MyClass("Hello Class");
alert(instance.attribute);
MyClass = function(){
this.attribute = 'Hello';
}
var instance = new MyClass();
alert(instance.attribute);
@fjunior87
fjunior87 / sampleClass.js
Created March 21, 2011 17:46
Sample Javascript Class
MyClass = function(){
}
var instance = new MyClass();