Skip to content

Instantly share code, notes, and snippets.

@dan-silver
dan-silver / wikipedia.js
Created April 23, 2012 03:55
Wikipedia Edits
console.log("Starting modifications to wikipedia!"); //writes a message to the console
$("#ca-history").css({ //Change the Background
"background" : "none"
});
$("#p-views, #ca-edit, #ca-view").css({ //Change the Background
"background" : "Black"
});
//landing page
<body id="www-wikipedia-org" class=" hasGoogleVoiceExt">
//other pages
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-Winged_unicorn skin-vector action-view hasGoogleVoiceExt">
@dan-silver
dan-silver / gist:4544696
Last active December 11, 2015 04:19
FQL Queries in the Facebook Checkins Explorer
{checkins: 'SELECT coords, author_uid, message,target_id, target_type, timestamp FROM checkin WHERE author_uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND timestamp > "'+(Math.round((new Date()).getTime()/1000)-365*24*60*60) + '" ORDER BY timestamp DESC LIMIT 0,100',
names: 'SELECT name,uid,pic_small,profile_url FROM user WHERE uid IN (SELECT author_uid FROM #checkins)',
events: 'SELECT name,page_id,page_url FROM page WHERE page_id IN (SELECT target_id FROM #checkins)'}
//Part of the passport code which authenticates the user
//Request two permissions from the user when they visit the homepage
app.get('/', passport.authenticate('facebook', {scope: ['friends_status', 'friends_events']}));
@dan-silver
dan-silver / gist:5514553
Created May 3, 2013 22:05
Generates a random username
lorem_ipsum = "Lorem ipsum dolor sit amet consectetur adipiscing elit Maecenas egestas libero eu mauris blandit vitae imperdiet dolor lacinia Sed ac diam vel urna viverra ullamcorper Nulla enim tortor mollis at venenatis at porta dui ligula sollicitudin non mollis non tincidunt arcu Mauris volat sagittis lorem nec tincidunt Vestibulum ipsum massa Mauris sit amet purus sit amet est feugiat gravida vel sed Proin quam sem Sed laoreet massa mauris laoreet non rhoncus lit iaculis Duis non risus augue vitae sagittis metus Fusce sagittis imperdiet massa sit amet mattis Proin sed scelerisque orci Aliquam grav justo non lacus rum tincidunt Donec faucibus sollicitudin felis eu porttitor dui porttitor faucibus";
lorem_ipsum_words = lorem_ipsum.split(" ");
function generateRandomWord() {
word = lorem_ipsum_words[Math.floor(Math.random()*lorem_ipsum_words.length)];
word = word[0].toUpperCase() + word.substring(1);
return word;
}
function generateUserName() {
<div class="et-wrapper et-rotate" et-in="rotateSlideIn" et-out="rotateSlideOut">
<div class="et-page">
<h2>Page 1</h2>
</div>
<div class="et-page">
<h2>Page 2</h2>
</div>
</div>
<div class="et-wrapper">
<button class="et-rotate" et-in="rotateSlideIn" et-out="rotateSlideOut">Next</button>
<div class="et-page">
<h2>Page 1</h2>
</div>
<div class="et-page">
<h2>Page 2</h2>
</div>
</div>
<div class="et-wrapper">
<div class="et-page">
<h2>Page 1</h2>
<button class="et-rotate" et-in="rotateCarouselRightIn" et-out="rotateCarouselRightOut">Next</button>
</div>
<div class="et-page">
<h2>Page 2</h2>
<button class="et-rotate" et-in="rotateCarouselLeftIn" et-out="rotateCarouselLeftOut">Back</button>
</div>
</div>
<link rel="stylesheet" type="text/css" href="elementTransitions.min.css" />
<script src="elementTransitions.min.js"></script>
<div class="et-wrapper et-rotate" et-out="scaleDown" et-in="scaleUpDown delay300">
<div class="et-page">
<h5>In:</h5>
scaleUpDown delay300
<h5>Out:</h5>
scaleDown
</div>
<div class="et-page">
<h5>In:</h5>
scaleUpDown delay300