Skip to content

Instantly share code, notes, and snippets.

View applehat's full-sized avatar
✝️
Sola Fide

Cameron Chunn applehat

✝️
Sola Fide
View GitHub Profile
@applehat
applehat / gist:3170393
Created July 24, 2012 14:48
jQuery Ajax example for PHP-XSS
var request = $.ajax({
url: "/url/to/your/xss.php",
data: {url : 'http://www.google.com/ig/api?weather=Mountain+View'},
dataType: "xml"
});
request.done(function(xml) {
var weather = $(xml).find("current_conditions > condition").attr('data');
alert('It is '+weather+' in Mountain View');
});
@applehat
applehat / twitter.hashtagify.js
Created July 24, 2012 01:44
Twitter Hashtagify
/*
* Accepts any string, and returns a twitter hastag of that string
* @text - String to convert to a hashtag
*/
function makeHashTag(text) {
var v = text.replace(/[^a-z0-9]/gi, '');
if (!isNaN(v[0])) {
var fixtr = "num";
switch (v[0]) {
@applehat
applehat / gist:3166446
Created July 23, 2012 21:49
php hello world
<?php
echo "hello world";
?>