Skip to content

Instantly share code, notes, and snippets.

View m-kirstetter's full-sized avatar

Manuel Kirstetter m-kirstetter

View GitHub Profile
a = setInterval(function () {
window.scrollTo(0,document.body.scrollHeight);
$('.not-following .user-actions-follow-button.js-follow-btn').click();
}, 1000);
// To stop it
clearInterval(a)
@m-kirstetter
m-kirstetter / gist:84755ed4b39f977de765
Created June 29, 2015 08:27
Twitter mass favorite
a = setInterval(function () {
window.scrollTo(0,document.body.scrollHeight);
$('.ProfileTweet-actionButton.js-actionButton.js-actionFavorite:visible').click();
}, 1000)
// To stop it
clearInterval(a)

CasperJS Google Suggest

The script:

/*global casper:true*/
var casper = require('casper').create({
    pageSettings: {
        userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Firefox/31.0"
 }
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
// PhantomJS Cheatsheet
$ brew update && brew install phantomjs // install PhantomJS with brew
phantom.exit();
var page = require('webpage').create();
page.open('http://example.com', function() {});
page.evaluate(function() { return document.title; });
// Mixpanel Cheatsheet
// This requires the mixpanel javascript library to be embedded on your site
// https://mixpanel.com/help/reference/javascript-full-api-reference
// 1. API Methods.
mixpanel.init('new token', { your: 'config' }, 'library_name'); // initialize a new instance of the Mixpanel tracking object
mixpanel.push(['register', { a: 'b' }]); // push() keeps the standard async-array-push behavior around after the lib is loaded. This is only useful for external integrations that do not wish to rely on our convenience methods (created in the snippet).
# SYNTAX:
var pattern = new RegExp(pattern, attributes); # attributes: g (global); i (case-sensitive); m (multiline matches)
var pattern = /pattern/attributes; # same as above
# BRACKETS:
[...]: Any one character between the brackets.
[^...]: Any one character not between the brackets.

Keybase proof

I hereby claim:

  • I am maunoxyd on github.
  • I am maunoxyd (https://keybase.io/maunoxyd) on keybase.
  • I have a public key whose fingerprint is D270 522E 4C69 FA86 F956 72F4 113B 77B9 DDD0 ED52

To claim this, I am signing this object: