Repository: swapagarwal/geeksay Branch: master Commit: 0ff761661d8d Files: 15 Total size: 41.3 KB Directory structure: gitextract_8nvy437p/ ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── config.yml │ │ └── feature-track.md │ ├── pull_request_template.md │ └── workflows/ │ └── ci.yml ├── .gitignore ├── .percy.yml ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── cli.js ├── geeksay.js ├── index.html ├── package.json └── test/ └── geeksay.test.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/ISSUE_TEMPLATE/config.yml ================================================ blank_issues_enabled: true ================================================ FILE: .github/ISSUE_TEMPLATE/feature-track.md ================================================ --- name: Feature (Hacktoberfest Track) about: Propose work within a Hacktoberfest 2025 track labels: hacktoberfest --- ### Track (e.g., Browser Extension) ### Problem / Motivation ### Proposed Scope (for the first PR) - [ ] ... ### Acceptance Criteria - [ ] Tests (if relevant) - [ ] Docs / README update - [ ] Screenshots (UI work) ================================================ FILE: .github/pull_request_template.md ================================================ ## Summary What does this change do? ## Track (e.g., track: playground) ## Screenshots / Demo (if UI) ## Checklist - [ ] Linked issue - [ ] Tests added/updated (if relevant) - [ ] `npm run lint` passes - [ ] Docs updated ================================================ FILE: .github/workflows/ci.yml ================================================ name: CI on: pull_request: push: branches: [master] jobs: build-and-test: runs-on: ubuntu-latest strategy: matrix: node-version: [18.x, 20.x] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: "npm" - run: npm ci - run: npm run lint --if-present - run: npm test --if-present ================================================ FILE: .gitignore ================================================ node_modules/ ## IDEs # Intelli J .idea/ *.iml # VS Code .code/ ================================================ FILE: .percy.yml ================================================ static-snapshots: snapshot-files: 'index.html' ================================================ FILE: .travis.yml ================================================ language: node_js node_js: - 'lts/*' script: - npm test - npx percy snapshot ================================================ FILE: CONTRIBUTING.md ================================================ ## Contributing The core of this project is the [geeksay.js](https://github.com/swapagarwal/geeksay/blob/master/geeksay.js) file. Contributions are welcome! 😇 > If you'd like to quickly send some geeky words (e.g. home -> 127.0.0.1) without using GitHub, you can submit them via this [form](https://goo.gl/forms/LcJkSgghhm68Ajvc2) or in this [sheet](https://docs.google.com/spreadsheets/d/166ExyRTa6PmtRfONKsaICiaUDTLgATCVQ0K5fMtJuW8/edit?usp=sharing). - For a small change, just send a PR. - For bigger changes, open an issue for discussion before sending a PR. - PR should include an example, if it makes sense. - You can also contribute by: - Reporting issues - Suggesting new features or enhancements - Improving documentation - Make sure not to format html files using prettier. It will break the format. - Also, make sure to format javascript files using prettier. ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2022 Swapnil Agarwal Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # geeksay [![Build Status](https://travis-ci.org/swapagarwal/geeksay.svg?branch=master)](https://travis-ci.org/swapagarwal/geeksay) [![npm version](https://img.shields.io/npm/v/geeksay)](https://www.npmjs.com/package/geeksay) [![npm downloads](https://img.shields.io/npm/dm/geeksay)](https://www.npmjs.com/package/geeksay) [![npm bundle size](https://img.shields.io/bundlephobia/min/geeksay)](https://www.npmjs.com/package/geeksay) [![This project is using Percy.io for visual regression testing.](https://percy.io/static/images/percy-badge.svg)](https://percy.io/swap/geeksay) [![open issues](https://img.shields.io/github/issues/swapagarwal/geeksay.svg)](https://github.com/swapagarwal/geeksay/issues?q=is%3Aopen+is%3Aissue) [![closed pull requests](https://img.shields.io/github/issues-pr-closed/swapagarwal/geeksay.svg)](https://github.com/swapagarwal/geeksay/pulls?q=is%3Apr+is%3Aclosed) [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](https://github.com/swapagarwal/geeksay/fork) > geeks will ctrl+s the world > There's no place like 127.0.0.1 > sometimes, i just need a `
` **geeksay** is a website and CLI to find geeky, cheesy phrases to send to your **Loved Ones** (or teammates 😉). You know how sometimes you find these really geeky quotes and wish the world had more of them? geeksay fixes that. Try it out at [http://geeksay.xyz](http://geeksay.xyz) 🤓 Featured on [npm weekly](https://medium.com/npm-inc/npm-weekly-221-npm-6-12-1-is-here-oss-sustainability-open-rfc-calls-more-eb6506c83311) 🤓 --- ## 🎃 Hacktoberfest 2025 We’re participating again — and this year we’re inviting **extraordinary contributions**, not just typo fixes! 👉 Check out the umbrella issue: **[#Hacktoberfest 2025 — Pick a Track](../../issues/XXX)** ### Contribution Tracks * **Browser Extension** (Chrome/Firefox/Edge) * **Playground UI + Share Cards** * **Quote/Translation Submission System** * **Quiz / Games** * **Accessibility + i18n** * **TypeScript Core + Tests** * **Geek Ipsum Generator** ### PR Guidelines * One **substantive** PR per contributor per day. * Group related changes together. * Include tests where relevant. * For UI work: screenshots/screen recordings required. * Run `npm run lint` before pushing. --- ## Install ```bash npm install -g geeksay ``` ## Usage ### Module ```js const geeksay = require('geeksay'); console.log(geeksay(`go hard or go home`)); // go hard || go 127.0.0.1 console.log(geeksay(`please make me a sandwich`)); // sudo make me a sandwich ``` ### CLI ```bash # install locally or globally npm install geeksay geeksay copy that # ctrl+c that geeksay to be or not to be, that is the question # to be || ! to be, that is the question ``` > Note: **Do not** put quotes around the phrase, even if it contains spaces! ### npx ```bash npx geeksay i was 5 and he was 6 # i was 101 && he was 110 npx geeksay sometimes i just need a break # sometimes i just need a
``` --- ## Test ```bash npm test ``` --- ## Contributing We ❤️ contributions! See the **[Hacktoberfest 2025 Umbrella Issue](../../issues/XXX)** to claim a track. For general guidelines, read **[CONTRIBUTING.md](./CONTRIBUTING.md)**. ================================================ FILE: cli.js ================================================ #!/usr/bin/env node const geeksay = require("./geeksay"); const [,, ...words] = process.argv; const translation = geeksay(words) console.log(translation); ================================================ FILE: geeksay.js ================================================ const translations = { hide: "incognito", hidden: "incognito", screenshot: "start+prt sc", input: "", into: "*", emotion: "emoticon", repeat: "loop", style: "css", save: "ctrl+s", break: "
", control: "ctrl", rule: "ctrl", escape: "esc", black: "#000", white: "#fff", bang: "!", not: "!", new: "ctrl+n", open: "ctrl+o", anchor: "", bold: "", cut: "ctrl+x", copy: "ctrl+c", paste: "ctrl+v", quit: "ctrl+q", close: "ctrl+w", help: "f1", rename: "f2", undo: "ctrl+z", redo: "ctrl+y", search: "ctrl+f", find: "ctrl+f", replace: "ctrl+r", print: "ctrl+p", greet: "ping", get: "git", got: "git", home: "127.0.0.1", bed: "127.0.0.1", house: "127.0.0.1", local: "127.0.0.1", localhost: "127.0.0.1", fuck: "fork", hello: "ping", hi: "ping", hey: "ping", command: "cmd", forget: "ctrl+z", world: "0.0.0.0/0", want: "require", need: "require", name: "alias", address: "url", pie: "π", function: "fn", kill: "alt+f4", stop: "abort", refresh: "f5", slow: "O(n^n)", fast: "O(1)", leet: "1337", hacker: "haxor", geek: "g33k", plus: "+", minus: "-", and: "&&", or: "||", binary: "01", call: "ping", me: "self", owner: "admin", god: "root", please: "sudo", at: "@", fix: "debug", shit: "dump", bullshit: "dump", poop: "dump", delete: "del", force: "ma", coffee: "covfefe", number: "#", image: "img", photo: "img", pic: "img", picture: "img", snap: "img", snapshot: "img", bye: "exit", noob: "n00b", life: "42", universe: "42", everything: "42", lifetime: "runtime", sleep: "shutdown", red: "#ff0000", green: "#00ff00", blue: "#0000ff", marry: "merge", propose: "commit", notfound: "404!", link: "url", send: "push", alternate: "alt", alternative: "alt", inspect: "ctrl+shift+i", equal: "=", remove: "rm", move: "mv", random: "rand", mathematics: "math", love: "<3", smile: ":)", sad: ":(", list: "ls", ok: "200", okay: "200", question: "?", history: "log", on: "1", off: "0", pixel: "px", say: "log", body: "", head: "", title: "", restart: "ctrl+alt+del", death: "BSOD", wait: "load", waiting: "loading", unauthorized: "401", nothing: "void", all: "*", lineartime: "o(N)", change: "alt", pink: "#ffc0cb", developer: "dev", switch: "alt+tab", information: "info", space: "' '", full: "overload", modulo: "%", mind: "database", heart: "SMPS", semicolon: ";", future: "ctrl+y", past: "ctrl+z", missing: "404!", unavailable: "503!", overloaded: "502!", forbidden: "403!", timeout: "408!", repository: "repo", disapperar: "heisenbug", clueless: "Jimmy", imaginary: "Unicorny", catastrophic: "hidenbug", useless: "reality 101 faliure", different: "nested", calling: "recursion", heartbeat: "ping", boobs: "80085", error: "404", top: "</head>", "not found": "404", run: "ctrl+F5", comment: "//comment", table: "<table>", gray: "#ccc", grey: "#ccc", correct: "legit", teapot: "418", moved: "301", bad: "400", gone: "410", form: "<form>", select: "<select>", leave: "alt+f4", mistake: "ERROR", divide: "/", happy: ":)", }; const translationsMap = new Map(Object.entries(translations)); const quotes = [ "Everything is under control", // Everything is under ctrl "Give me a break", // Give me a <br> "Hello World", // ping 0.0.0.0/0 "Bye World", // exit 0.0.0.0/0 "Forget that ever happened", // ctrl+z that ever happened "Home is where the heart is", // 127.0.0.1 is where the SMPS is "Home is where ideas come to life", // 127.0.0.1 is where ideas come to 42 "Home is where the wifi connects automatically", // 127.0.0.1 is where the wifi connects automatically "fuck that shit", // fork that dump "go hard or go home", // go hard || go 127.0.0.1 "I will call you", // I will ping you "I want the world to know me", // I require the 0.0.0.0/0 to know self "I am the owner", // I am the admin "I am God", // I am root "please make me a sandwich", // sudo make self a sandwich "coffee is life", // covfefe is 42 "what's your name", // what's your alias "I will find you and I will fix you!", // I will ctrl+f you && I will debug you! "I need help", // I require f1 "geek alert", // g33k alert "geek inside", // g33k inside "copy that!", // ctrl+c that! "get out of home", // git out of 127.0.0.1 "not everything is black and white", // ! 42 is #000 && #fff "to be or not to be, that is the question", // to be || ! to be, that is the ? "i was 5 and he was 6", // i was 101 && he was 110 "he wore black and i wore white", // he wore #000 && i wore #fff "bang bang my baby shot me down", // ! ! my baby shot self down "Today is the first day of the rest of your lifetime", // Today is the first day of the rest of your runtime "i need to sleep", // i require to shutdown "There are ten types of people in the world: those who understand binary and those who don't", // There are ten types of people in the world: those who understand 01 && those who don't "I love my life", // I <3 my 42 "I love my house", // I <3 my 127.0.0.1 "heart break", // SMPS <br> "I like to fix shit", // I like to debug dump "eat sleep code repeat", // eat shutdown code repeat "roses are red, violets are blue", // roses are ##ff0000, violets are ##0000ff "The greatest trick the devil ever pulled was convincing the world he didn't exist", // The greatest trick the devil ever pulled was convincing the 0.0.0.0/0 he didn't exist "home sweet home", // 127.0.0.1 sweet 127.0.0.1 "history repeats itself", // log repeats itself "My dog likes to greet me at the door.", // My dog likes to ping me at the door. "keep calm and geek on", // keep calm && g33k 1 "somebody save me", // somebody ctrl+s me "Easy as pie", // easy as π "Live, laugh, love", // live, laugh, <3 "Green with envy", // #00ff00 with envy "There's no place like home", //There's no place like 127.0.0.1 "Green with envy", // #00ff00 with envy "Once in a blue moon", //Once in a #0000ff moon "Hello All", // Hello * "It is lineartime", // It is o(N) "you yourself are the anchor of your life", //you yourself are the <a> of your life "you are the love of my life", //you are the <3 of my 42 "pink panther", // #ffc0cb panther "Get busy living or get busy dying", // git busy living || git busy dying "out of the blue", // out of the #0000ff "caught red-handed", // caught #ff0000 handed "I love you", //I <3 you "He has a style", //He has a css "hide it!", //incognito it! "99 little bugs in the code. 99 little bugs in the code. Take one down, patch it around. 127 little bugs in the code", //cb - so many bugs "Hey Google! Find me the best repo.", //ping Google! ctrl+f self the best repo "I need to restart my life", // I require to ctrl+alt+del my 42 "Paste my Code", // ctrl+v my Code "Paste my Copy", // ctrl+v my ctrl+c "What's new?", // What's ctrl+n "You're done coding! Go to sleep.", // You're done coding! Go to shutdown "Life is a big question that even Google can't find answer.", //42 is a big ? that even Google can't ctrl+f answer "Have no friends not equal to yourself.", // Have no friends ! = to yourself "The past does not equal the future.", //The past does ! = the future "I just switch tabs, not the love ones", // I just alt+tab tabs, not the <3 ones "I have not failed. I’ve just found 10,000 ways that won’t work", // I have ! failed. I’ve just found 0 ways that won’t work "Life is a big question that even Google can't find answer.", //42 is a big ? that even Google can't ctrl+f answer "Have no friends not equal to yourself.", // Have no friends ! = to yourself "The past does not equal the future.", //The past does ! = the future "I just switch tabs, not the love ones", // I just alt+tab tabs, not the <3 ones "to be or not to be", // 2b || !2b "programming joke", // My </code> "home sweet home", // 127.0.0.1 sweet 127.0.0.1 "politics is bullshit", //politics is dump "I want the address of my love", // I want the url of my <3 "Never get to bed mad, stay up and snap", // Never git to 127.0.0.1 mad,stay up && img "Heart is missing", //SMPS is 404! "Information is lost from the deleted repository", //Info is lost from the del repo "Be different", // Be != "Don't leave blank space in your code!", // Don't alt+f4 blank ' ' in your code! "Sometimes it's okay to run", // Sometimes it's okay to ctrl+F5 "Divide and conquer", // / and conquer "It's nice to find love, propose, send gifts, marry and live happy life", // It's nice to ctrl+f <3, commit, push gifts, merge && live :) 42 "Thou shall not pass", // Thou shall ! pass ]; function isNumeric(num) { return !isNaN(parseInt(num)); } function geeksay(text) { const input = Array.isArray(text) ? text : String(text).split(" "); return input.map(geeksayPhrase).join(" "); } function geeksayPhrase(word, index, words) { const currentWord = removeSymbols(word).toLowerCase(); if (!words[index + 1]) return geeksayWord(currentWord); const nextWord = removeSymbols(words[index + 1]).toLowerCase(); const translatedPhrase = translationsMap.get(currentWord + " " + nextWord); if (translatedPhrase) { words.splice(index, 1); return translatedPhrase; } return geeksayWord(currentWord); } function containsSpecialChars(str) { const specialChars = /[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~a-zA-Z]/; return specialChars.test(str); } function geeksayWord(word) { // skipping this geekification if the word was already geekified if ([...translationsMap.values()].includes(word)) return word; return isNumeric(word) ? handleNumeric(word) : handleText(word); } function handleNumeric(word) { for (var i = 0; i < word.length; i++) { if (containsSpecialChars(word)) { return word.toString(2); } else { return (word >>> 0).toString(2); } } } function handleText(word) { return ( translationsMap.get(removeSymbols(word).toLowerCase()) || word.toLowerCase() ); } function removeSymbols(word) { return word.replace(/(?!\n|\r\n)[^a-zA-Z0-9 ]+/, ""); } function getRandomTranslation() { const keys = Object.keys(translations); const randomKey = keys[Math.floor(Math.random() * keys.length)]; return "Random Translation: " + randomKey + " -> " + translations[randomKey]; } function getRandomQuote() { return quotes[Math.floor(Math.random() * quotes.length)]; } module.exports = geeksay; ================================================ FILE: index.html ================================================ <!DOCTYPE html> <html lang="en"> <head> <title>geeksay

Geeksay

From layman 👶

(just start typing!)




To geek 🤓   





Need an API?


================================================ FILE: package.json ================================================ { "name": "geeksay", "version": "1.2.1", "description": "🤓 geeks will ctrl+s the world!", "main": "geeksay.js", "bin": { "geeksay": "./cli.js" }, "scripts": { "test": "node_modules/.bin/mocha test/*" }, "repository": { "type": "git", "url": "git+https://github.com/swapagarwal/geeksay.git" }, "keywords": [ "translate", "layman", "geek", "api" ], "author": "Swapnil Agarwal (http://swapnil.net)", "license": "ISC", "bugs": { "url": "https://github.com/swapagarwal/geeksay/issues" }, "homepage": "https://github.com/swapagarwal/geeksay#readme", "devDependencies": { "mocha": "^11.7.3", "percy": "^5.0.0", "should": "^13.2.3" }, "dependencies": { "esprima": "^4.0.1", "npm-check-updates": "^19.0.0" } } ================================================ FILE: test/geeksay.test.js ================================================ const should = require("should"); const esprima = require("esprima"); const fs = require("fs"); const geeksay = require("../geeksay"); describe("words", () => { it("love", () => { should.equal(geeksay("love"), "<3"); }); it("LOVE - case insensitive ", () => { should.equal(geeksay("LOVE"), "<3"); }); it("not", () => { should.equal(geeksay("not"), "!"); }); it("NOT - case insensitive", () => { should.equal(geeksay("NOT"), "!"); }); it("slow", () => { should.equal(geeksay("slow"), "O(n^n)"); }); it("SloW - case insensitive", () => { should.equal(geeksay("SloW"), "O(n^n)"); }); it("semicolon", () => { should.equal(geeksay("semicolon"), ";"); }); }); describe("quotes", () => { it("Hello World", () => { should.equal(geeksay("Hello World"), "ping 0.0.0.0/0"); }); it("heLLo WorlD - case insensitive", () => { should.equal(geeksay("heLLo WorlD"), "ping 0.0.0.0/0"); }); it("I love my house", () => { should.equal(geeksay("I love my house"), "I <3 my 127.0.0.1"); }); it("I have not failed. I’ve just found 10,000 ways that won’t work", () => { should.equal(geeksay("I have not failed. I’ve just found 10,000 ways that won’t work"), "I have ! failed. I’ve just found 0 ways that won’t work"); }); }); describe("multi-line and symbols", () => { it(`Every day after waking up \\n I say Hello World and \\n hi \\n to the world `, () => { should.equal( geeksay(`Every day after waking up I say Hello World and hi to the world `), `Every day after waking up I log ping 0.0.0.0/0 && hi to the 0.0.0.0/0 ` ); }); it("space", () => { should.equal( geeksay("I love my house"), "I <3 my 127.0.0.1" ); }); it("symbols #1", () => { should.equal(geeksay("I love my @ house"), "I <3 my @ 127.0.0.1"); }); it("symbols #2", () => { should.equal(geeksay("(=> I love my house )"), "(=> I <3 my 127.0.0.1 )"); }); it("symbols #3", () => { should.equal(geeksay("I love my house!"), "I <3 my 127.0.0.1!"); }); it("symbols #4", () => { should.equal( geeksay("Roses are red, violets are blue."), "Roses are #ff0000, violets are #0000ff." ); }); }); describe("html tags", () => { it("inside tag with space", () => { should.equal( geeksay(' Hello World '), ' ping 0.0.0.0/0 ' ); }); // TODO: // it('inside tag without space', () => { // should.equal(geeksay('Hello World'), 'ping 0.0.0.0/0'); // }); }); describe("inputs", () => { it("input as array", () => { should.equal(geeksay(["hello", "my", "love"]), "ping my <3"); }); it("null", () => { should.equal(geeksay(null), "null"); }); it("undefined", () => { should.equal(geeksay(undefined), "undefined"); }); it("object", () => { should.equal(geeksay({ Hello: "World" }), "[object Object]"); }); it("array of numbers", () => { should.equal(geeksay([1, 2, 3, 4, "100"]), "1 10 11 100 1100100"); }); }); describe("code checks", () => { it("duplicate translation entries", () => { const libfile = "../geeksay.js"; // Library file location const varname = "translations"; // Variable to check for duplicate entries var code = fs.readFileSync(__dirname + "/" + libfile, "utf8"); var ast = esprima.parse(code); // Find 'translations' variable and extract entries' keys var duplicates; for (const i in ast.body) { let decl = ast.body[i]; if (decl.type == "VariableDeclaration") { for (const j in decl.declarations) { if (decl.declarations[j].id.name == varname) { translations = decl.declarations[j]; entries = translations.init.properties.map( (prop) => prop.key.value ); duplicates = entries.filter( (item, index) => entries.indexOf(item) != index ); } } } } // Case if 'translations' variable was not found and 'duplicates' is therefore undefined if (typeof duplicates == "undefined") { throw Error( "Variable '" + varname + "' was not found in library file (" + libfile + ")." ); } // The number of duplicates should be 0 should.equal( duplicates.length, 0, "Found duplicate " + duplicates.length + " entries: " + duplicates.map((entry) => '"' + entry + '"').join(", ") ); }); });