Skip to content

Instantly share code, notes, and snippets.

@leafo
Created February 4, 2014 22:25
Show Gist options
  • Save leafo/8813608 to your computer and use it in GitHub Desktop.
Save leafo/8813608 to your computer and use it in GitHub Desktop.
find missing candyjam games
import GamesSearch, JamGames from require "models"
import get_all_pages from require "util"
pager = GamesSearch\text "candy"
all_games = get_all_pages pager
game_ids = table.concat [game.id for game in *all_games], ", "
print "Games #{#all_games}"
jgs = JamGames\select "where jam_id = 1"
print "Jam games #{#jgs}"
jgs_by_game_id = {jg.game_id, jg for jg in *jgs}
missing_games = for game in *all_games
continue if jgs_by_game_id[game.id]
game
print #missing_games
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment