This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const path = require('path'); | |
const execSync = require('child_process').execSync; | |
const regex = /^(import PropTypes from 'prop-types';)\n(\/\/ \(C\) Copyright.*)\n\n(import React(?:.*) from 'react';)([\s\S]*)$/; | |
const processDirectory = (dir) => { | |
fs.readdirSync(dir).forEach((file) => { | |
if (fs.lstatSync(path.join(dir, file)).isDirectory()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The input, an arbitrarily nested array | |
const input = [ | |
[1, 2, 3], | |
[4, 5, 6, [7, 8, [9, [10]]]] | |
]; | |
/** | |
* Recursive function to be called on arrays | |
* @param array The input array | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../polymer/polymer.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
#design_host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First of all, to prevent something like this happening again, review the apps you have permitted at https://twitter.com/settings/applications and remove the ones you suspect. | |
Login and open your following page at https://twitter.com/USERNAME/following and scroll down until you reach the people you actually followed. | |
Open Developer Console (Web Console in Firefox - Ctrl + Shift + K) or (Developer Tools in Chrome - Ctrl + Shift + J). | |
Paste the following line of code and press enter. It finds the buttons (both follow and unfollow) and clicks them one by one. Note that your browser may show an unresponsive script dialog. Choose continue. | |
Array.from(document.getElementsByClassName("user-actions-follow-button js-follow-btn follow-button btn small small-follow-btn")).forEach((button) => {button.click()}) |