Skip to content

Instantly share code, notes, and snippets.

View heyalexej's full-sized avatar

Alexej heyalexej

  • rather hard to pin down
View GitHub Profile
@heyalexej
heyalexej / contentscript.js
Created August 6, 2015 12:35
Quick & Dirty Chrome Extension to Skip Annoying Forbes Interstitial Ads
(function (){
function log(t){
console.log("ForbesSkip: " + t);
}
function tryAgain(f){
log("Not fully loaded yet, try again.");
window.setTimeout(f, 200);
}
jQuery(document).ready(function() {
var originalTitle = document.getElementsByTagName("title")[0].innerHTML;
jQuery(window).on("blur", function() {
timerId = setTimeout(function() {
document.getElementsByTagName("title")[0].innerHTML = "(1) " + originalTitle;
}
, 2000);
}
);
jQuery(window).on("focus", function() {
// var s = document.createElement('script');
// s.type = 'text/javascript';
// // s.async = true;
// if (my fancy sampling condition) {
// js.src = "//remote-domain.com/script-1.js";
// } else {
// js.src = "//remote-domain.com/script-2.js";
// }
// var s = document.createElement('script');
// s.type = 'text/javascript';
// // s.async = true;
// if (my fancy sampling condition) {
// js.src = "//remote-domain.com/script-1.js";
// } else {
// js.src = "//remote-domain.com/script-2.js";
// }
@heyalexej
heyalexej / chat-spam.js
Created July 21, 2015 18:00
Dirty Chat Spammer
function guid() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
}
function chat() {
var e = document.getElementsByTagName("a");
for(i = 0; i < e.length; i++){
var s = e[i].href;
var t = e[i].text
if(!s.match('digitalimpact')){
console.log(t + ",", s);}
}
Magdeleine, http://magdeleine.co/
Public Domain Archive, http://publicdomainarchive.com/
@heyalexej
heyalexej / twitter_counts.py
Created July 10, 2015 11:21
Get http and https Twitter share counts for https://twitter.com/peeplaja
#!/usr/bin/env python2
import requests, json
api = 'http://urls.api.twitter.com/1/urls/count.json?url='
protocols = ['http://', 'https://']
def get_all(url):
'''check twitter API for URLs with both protocols'''
counts = []
var e = document.getElementsByTagName("a");
for(i = 0; i < e.length; i++){
var s = e[i].href;
if(s.match(/\/gp\/product\//)){console.log(s);}
}
http://sourceforge.net/projects/alienarena.mirror/
http://sourceforge.net/projects/altdrag.mirror/
http://sourceforge.net/projects/amaya.mirror/
http://sourceforge.net/projects/android-notifier.mirror/
http://sourceforge.net/projects/android-wifi-tether.mirror/
http://sourceforge.net/projects/android-wired-tether.mirror/
http://sourceforge.net/projects/apachederby.mirror/
http://sourceforge.net/projects/apachehttp.mirror/
http://sourceforge.net/projects/aptana.mirror/
http://sourceforge.net/projects/apt-mirror/
<script type="text/javascript">var submitted=false;</script>
<iframe name="hidden_iframe"
id="hidden_iframe"
style="display:none;"
onload="if(submitted) {window.location='http://domain.com/thanks.html';}">
</iframe>
<form action="https://docs.google.com/forms/d/cdjhesjd2763jhdjsshdjdshdjs267263723jhj23hjc/formResponse"
method="post"
target="hidden_iframe"
onsubmit="submitted=true;">