Skip to content

Instantly share code, notes, and snippets.

View yesil's full-sized avatar
🍉

Ilyas Türkben yesil

🍉
View GitHub Profile
import org.apache.jackrabbit.oak.spi.commit.CommitInfo
import org.apache.jackrabbit.oak.spi.commit.EmptyHook
import org.apache.jackrabbit.oak.spi.state.NodeState
import org.apache.jackrabbit.oak.spi.state.NodeBuilder
class LibsCleaner {
def session
def scanBundles(remove = false) {
@yesil
yesil / jenkins-groovy-command-ace-support.js
Created February 26, 2013 15:22
This script creates a nice code editor thanks to the beautiful ace library for the groovy command in jenkins job configurations. The files mode-groovy.js theme-textmate.js should be in the directory jenkins/userContent The ace library itself can be set in the javascript console. This script is tested only with chrome.
ace.config.set("modePath", "/userContent");
ace.config.set("themePath", "/userContent");
var groovyCommand = document.getElementsByName("groovy.command")[0];
groovyCommand.setStyle('position:absolute;top:-10000px;left;-10000px;');
var editor = document.createElement('div');
editor.setAttribute('id','editor');
editor.setStyle('position:relative; width:100%; min-height:500px;');
editor.textContent = groovyCommand.textContent;
@yesil
yesil / chrome.xpath.js
Created December 10, 2012 16:34
How to xpath in chrome developer console
var el = document.evaluate("//ul[1][@class='some_class_name']/li[2]/a",document, null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null)
el.snapshotItem()
@yesil
yesil / fbhack.js
Created February 16, 2012 16:25
facebook hack
// après avoir surchargé l'API facebook comme ci-dessous
FB.XFBML._getDomElements = function (a, e, d) {
var c = e + '-' + d;
if(FB.UA.ie())
return document.querySelectorAll('.'+c);
else
return a.getElementsByClassName(c);
};
@yesil
yesil / killbackspace.js
Created December 2, 2011 13:31
kill backspace in browsers(ff 3.6 ok, IE 8 ok)
$(document).keydown(function(e){
return (e.which != 8 || e.target.nodeName =='TEXTAREA' || e.target.nodeName == 'INPUT' && e.target.attributes.type.value == 'text');
});
class Ads {
val formatter = ISODateTimeFormat.dateTime()
var date:DateTime = new DateTime
lazy val mongoColl = MongoConnection()("abc")("ads")
def list = {
val q = MongoDBObject("published" -> MongoDBObject("$lt" -> date))