Skip to content

Instantly share code, notes, and snippets.

View asteadman's full-sized avatar
🤯
hacking

Andrew Steadman asteadman

🤯
hacking
View GitHub Profile
@asteadman
asteadman / md-to-html-example.html
Last active June 14, 2017 21:41
Convert basic markdown documents into something anyone can open with a web browser. Great for documentation.
<!-- turns markdown into html --><script type="text/javascript" src="md-to-html.js"></script>
# Heading
paragraph Text.
- list 1
- list 2
- list 3
And this is what code looks like:
@asteadman
asteadman / targeted-auto-follow.js
Last active July 13, 2016 18:46 — forked from thomasrstegelmann/targeted-auto-follow.js
I modified Karan's script to follow only profiles that match a certain keywords to follow only relevant accounts. Please see https://medium.com/marketing-102/how-i-grew-from-300-to-5k-followers-in-just-3-weeks-2436528da845#.75mau0pj9 for details. USE AT YOUR OWN RISK.
a = setInterval(function () {
window.scrollTo(0,document.body.scrollHeight);
$(".ProfileCard-content").not(".parsed").each( function() {
$(this).addClass('parsed');
var bioGood = $(this).find('.ProfileCard-bio').text().match(new RegExp("REGEXPSTRING", "gi")) !== null;
var profileGood = $(this).find('img.ProfileCard-avatarImage').attr('src').indexOf("default_profile_images") === -1;
var bannerGood = $(this).parent().find('.ProfileCard-bg').css('background-image') !== 'none';

Thoughts

The main problem is locking and dealing with multiple computers sharing a repository. In general, s3 is eventually consistent. It does (as of Aug 4, 2015) have read-after-write consistency in all regions for all NEW files, but updates/deletions to existing files are still only eventually consistent. Additionally, listing of directories is also only eventually consistent, so you may not see a file in the directory list for some time after its created (However, if you knew its name, you could read it immediately after it was created -> this is the read after write consistency that s3 now has in all regions).

Now, locking the repository when the repository itself is only eventually consistent is going to be problematic - ideally coming up with a system that does not require locking would be the best. Alternatively the locking could be done out-of-band using something strongly consistent ( ie: dynamodb? ). I'm only going to consider the former approach, since extra dependencies and configuration are