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
event.registerComplexPeripheral("gt_input_machine", metaMachineWrapper((machine) => { | |
return !!machine && (!!machine.importItems || !!machine.combinedInventory) | |
})) | |
.mainThreadMethod("exportInputItem", metaMachineWrapper((machine, block, _, args, computer) => { | |
if (args.length < 4) throw new Error("exportInputItem(fromSlot, strPeriphToName, toSlot, amount)") | |
const slotIndex = toInt(args[0]) - 1 | |
const toName = args[1] | |
const toSlot = toInt(args[2]) - 1 | |
const amount = toInt(args[3]) | |
const storage = (machine.importItems || machine.inventory).storage |
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 ALPHA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('') | |
const RALPHA = new Map(ALPHA.map((e, i)=>[e, i])) | |
const rotBy = (word, n) => word.split('').map((l) => ALPHA[(RALPHA.get(l) + n) % ALPHA.length]).join('') | |
const rotByP = (word, n) => word.split('').map((l, i) => ALPHA[(RALPHA.get(l) + n + i) % ALPHA.length]).join('') | |
let list = fs.readFileSync('./mots.txt').toString().split('\n').filter(Boolean) | |
let set = new Set(list) | |
const stats = [] |
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
let langStats = {} | |
data.forEach(e => { | |
langStats[e.tweet_lang] = (langStats[e.tweet_lang] || 0) + 1 | |
}) | |
console.log(Object.entries(langStats).sort(([langA, countA], [langB, countB]) => countA < countB ? 1 : -1) | |
.slice(0, 10).map(([lang, count]) => `${lang} ${Math.floor((count / data.length) * 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
var twitter = require('twitter'); // npm install twitter | |
var tokens = require('./tokens.json'); // Tokens stockés en JSON, cf. lignes 7 à 10 pour la structure de l'objet | |
var MAIN_ACCOUNT = "NomDuCompte"; // Nom du compte de votre bot | |
// Configuration/construction de l'interface client | |
var client = new twitter({ // J'aurais pu juste mettre "var client = new twitter(tokens);" | |
consumer_key: tokens.consumer_key, // Clé API de l'app | |
consumer_secret: tokens.consumer_secret, // Clé secrete app | |
access_token_key: tokens.access_token_key, // Clé OAuth associée au compte du bot via l'app | |
access_token_secret: tokens.access_token_secret // Clé secrète OAuth associée au compte du bot via l'app |
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
var twitter = require('twitter'); // npm install twitter | |
var tokens = require('./tokens.json'); // Tokens stockés en JSON, cf. lignes 7 à 10 pour la structure de l'objet | |
var MAIN_ACCOUNT = "NomDuCompte"; // Nom du compte de votre bot | |
// Configuration/construction de l'interface client | |
var client = new twitter({ // J'aurais pu juste mettre "var client = new twitter(tokens);" | |
consumer_key: tokens.consumer_key, // Clé API de l'app | |
consumer_secret: tokens.consumer_secret, // Clé secrete app | |
access_token_key: tokens.access_token_key, // Clé OAuth associée au compte du bot via l'app | |
access_token_secret: tokens.access_token_secret // Clé secrète OAuth associée au compte du bot via l'app |
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
var twitter = require('twitter'); // npm install twitter | |
var tokens = require('./tokens.json'); // Tokens stockés en JSON, cf. lignes 7 à 10 pour la structure de l'objet | |
var MAIN_ACCOUNT = "NomDuCompte"; // Nom du compte de votre bot | |
// Configuration/construction de l'interface client | |
var client = new twitter({ // J'aurais pu juste mettre "var client = new twitter(tokens);" | |
consumer_key: tokens.consumer_key, // Clé API de l'app | |
consumer_secret: tokens.consumer_secret, // Clé secrete app | |
access_token_key: tokens.access_token_key, // Clé OAuth associée au compte du bot via l'app | |
access_token_secret: tokens.access_token_secret // Clé secrète OAuth associée au compte du bot via l'app |