node hamster-kombat-playground-games-promo-keys-generator.jsUpdate line with users you want to generate promo codes for:
| // Use built in or binary modules | |
| var crypto = require('crypto'); | |
| var hash = crypto.createHmac("sha1",key).update(signatureBase).digest("base64"); |
| <form action="<%= action %>" method="post"> | |
| <% if (fields.length) { %> | |
| <% fields.forEach(function(field){ %> | |
| <label><%= field.name %></label> | |
| <input type="<%= field.type %>" name="<%= field.name %>" <% if (field.property) { %> <%= field.property %> <% } %> > | |
| <% }) %> | |
| <% } %> | |
| <button type="submit"><%= title %></button> <!--Title for button is same as that of the page--> |
| // Customizable variables | |
| var minValue = 0.00000001; | |
| var maxLoss = 0.0000001; | |
| var aimedProfit = 0.000005; | |
| var maxOps = 50; | |
| // Don't touch anything after this | |
| var endResult = 0; | |
| var ops = 0; |
| # Based on this answer: https://stackoverflow.com/a/61859561/1956278 | |
| # Backup old data | |
| Rename-Item -Path "./data" -NewName "./data_old" | |
| # Create new data directory | |
| Copy-Item -Path "./backup" -Destination "./data" -Recurse | |
| Remove-Item "./data/test" -Recurse | |
| $dbPaths = Get-ChildItem -Path "./data_old" -Exclude ('mysql', 'performance_schema', 'phpmyadmin') -Recurse -Directory | |
| Copy-Item -Path $dbPaths.FullName -Destination "./data" -Recurse |
| <?php | |
| // PHP memory limit for this site | |
| define( 'WP_MEMORY_LIMIT', '128M' ); | |
| define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit. | |
| // Database | |
| define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database. | |
| define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users) | |
| // Explicitely setting url |
| <?php | |
| error_reporting( error_reporting() & ~E_NOTICE ); // evil | |
| // config | |
| $enable_jsonp = false; | |
| $enable_native = false; | |
| $valid_url_regex = '/.*/'; | |
| // ############################################################################ |
| const getElementsByText = (text, parent) => { | |
| if (!text) return [] | |
| const xpath = `//*[text()='${text}']` | |
| const xpathResult = document.evaluate( | |
| xpath, | |
| parent || document, | |
| null, | |
| XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, | |
| null | |
| ) |
| .fa.fa-twitter{ | |
| font-family:sans-serif; | |
| } | |
| .fa.fa-twitter::before{ | |
| content:"𝕏"; | |
| font-size:1.2em; | |
| } |