Skip to content

Instantly share code, notes, and snippets.

@kelsin
Last active April 8, 2025 22:38
Show Gist options
  • Select an option

  • Save kelsin/2416b7f272d5bf1c114f6ab764ca7ac7 to your computer and use it in GitHub Desktop.

Select an option

Save kelsin/2416b7f272d5bf1c114f6ab764ca7ac7 to your computer and use it in GitHub Desktop.

Revisions

  1. kelsin revised this gist Apr 8, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 18xx.games.bookmark.js
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ javascript: (() => {
    fetch("/api/game")
    .then(response => response.json())
    .then(response => response.games)
    .then(games => games.find(x => x.acting.includes(playerId)))
    .then(games => games.find(x => x.acting.includes(parseInt(playerId))))
    .then(game => {
    if (game) {
    window.location.href = `/game/${game.id}`;
  2. kelsin renamed this gist Apr 8, 2025. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. kelsin renamed this gist Apr 8, 2025. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. kelsin revised this gist Apr 8, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ javascript: (() => {
    if (!(window.location.href.match('https://18xx.games'))) {
    window.location.href = `https://18xx.games`;
    }
    const playerId = $('#nav').children[1].href.match(/profile\/(\d+)/)[1];
    const playerId = document.getElementById('nav').children[1].href.match(/profile\/(\d+)/)[1];
    fetch("/api/game")
    .then(response => response.json())
    .then(response => response.games)
  5. kelsin revised this gist Apr 8, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    javascript: (() => {
    const playerId = 130;
    if (!(window.location.href.match('https://18xx.games'))) {
    window.location.href = `https://18xx.games`;
    }
    const playerId = $('#nav').children[1].href.match(/profile\/(\d+)/)[1];
    fetch("/api/game")
    .then(response => response.json())
    .then(response => response.games)
  6. kelsin created this gist Apr 8, 2025.
    17 changes: 17 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    javascript: (() => {
    const playerId = 130;
    if (!(window.location.href.match('https://18xx.games'))) {
    window.location.href = `https://18xx.games`;
    }
    fetch("/api/game")
    .then(response => response.json())
    .then(response => response.games)
    .then(games => games.find(x => x.acting.includes(playerId)))
    .then(game => {
    if (game) {
    window.location.href = `/game/${game.id}`;
    } else {
    window.location.href = `/`;
    }
    });
    })();