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
// ==UserScript== | |
// @name Goodbye new FB ads | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Remove facebook ads | |
// @author Maurizio Carboni | |
// @match https://www.facebook.com/* | |
// @grant none | |
// ==/UserScript== |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
.node { | |
cursor: pointer; | |
} | |
.node circle { | |
fill: #fff; |
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
//Paste this script on the console | |
//Config var, change this var at runtime to change the message | |
var autoMessage = prompt('Message to send'); | |
//Support var | |
var isActive = false; | |
//Check every 200ms if the status of the textarea is changed | |
setInterval(function() { | |
var isActiveNow = !document.querySelector('textarea.chatmsg').disabled; | |
//If the textarea was previously disabled and now is enabled, means that we are meeting a new stranger | |
//And obviously check if we have a message to send |
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
import fs from 'fs'; | |
import readline from 'readline'; | |
const words = {}; | |
const wordReader = readline.createInterface({ | |
input: fs.createReadStream('words.italian.txt','utf8') | |
}); | |
wordReader.on('line',( word ) => { | |
if ( word.length ) { |
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 blackCharacter = '#'; | |
export function getStructure( matrix ) { | |
const lineLength = matrix.length && matrix[0].length; | |
const dictionary = []; | |
for ( let i=0; i<matrix.length; i++) { | |
for ( let j=0; j<lineLength; j++ ) { | |
// Horizontal | |
if ( j==0 || matrix[i][j-1] === blackCharacter && matrix[i][j] !== blackCharacter ) { | |
let a=j; |
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
export function fillBlanks( { index=0, structure, matrix, words }) { | |
const { col , row, length, horizontal } = structure[index]; | |
const spaceStatus = getSpaceStatus({ matrix, length, col, row, horizontal }); | |
const validWords = getPossibleWords({ words : words[length], spaceStatus }); | |
if ( validWords.length ) { | |
return tryAllWords({ validWords, words, structure, index : index+1, matrix, col , row, length, horizontal }); | |
} | |
return 0; | |
} |
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
********** | |
*#*#*##*## | |
********** | |
*#*#*##*## | |
********** | |
*#*#*##*## | |
********** | |
*#*#*##*## | |
*#******** | |
*#*#*##*## |