Skip to content

Instantly share code, notes, and snippets.

@straker
straker / README.md
Last active April 16, 2024 08:49
Basic Tetris HTML and JavaScript Game

Basic Tetris HTML and JavaScript Game

This is a basic implementation of the game Tetris, but it's missing a few things intentionally and they're left as further exploration for the reader.

Further Exploration

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@IMcPwn
IMcPwn / delete-all-messages.js
Last active July 12, 2023 19:41 — forked from niahoo/delete-all-messages.js
Delete all messages in a Discord channel
// Turn on Developer Mode under User Settings > Appearance > Developer Mode (at the bottom)
// Then open the channel you wish to delete all of the messages (could be a DM) and click the three dots on the far right.
// Click "Copy ID" and paste that instead of LAST_MESSAGE_ID.
// Copy / paste the below script into the JavaScript console.
// If you're in a DM you will receive a 403 error for every message the other user sent (you don't have permission to delete their messages).
var before = 'LAST_MESSAGE_ID';
clearMessages = function(){
const authToken = document.body.appendChild(document.createElement`iframe`).contentWindow.localStorage.token.replace(/"/g, "");
const channel = window.location.href.split('/').pop();
@wavezhang
wavezhang / java_download.sh
Last active April 26, 2024 10:36
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
{
"success": true,
"itemTemplates": [
{
"templateId": "BADGE_BATTLE_ATTACK_WON",
"badgeSettings": {
"badgeType": "BADGE_BATTLE_ATTACK_WON",
"badgeRank": 4,
"targets": [
10,
anonymous
anonymous / GAME_MASTER_POKEMON_v0_2.tsv
Created July 16, 2016 19:26
Pokemon from GAME_MASTER protobuf file v0.2 in a .tsv
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 27 columns, instead of 12. in line 2.
PkMn BaseStamina BaseAttack BaseDefense Type1 Type2 BaseCaptureRate BaseFleeRate CollisionRadiusM CollisionHeightM CollisionHeadRadiusM MovementType MovementTimerS JumpTimeS AttackTimerS QuickMoves CinematicMoves AnimTime Evolution EvolutionPips PokemonClass PokedexHeightM PokedexWeightKg HeightStdDev WeightStdDev FamilyId CandyToEvolve
1 90 126 126 HoloPokemonType.POKEMON_TYPE_GRASS HoloPokemonType.POKEMON_TYPE_POISON 0.1599999964237213 0.10000000149011612 0.3815000057220459 0.6539999842643738 0.27250000834465027 HoloPokemonMovementType.POKEMON_ENC_MOVEMENT_JUMP 10.0 1.149999976158142 29.0 d601dd01 5a3b76 6d56d53fdaac2a3f6d56d53f93a9ea3f0000000036ab0a403333b33fbfbbbb3f 02 HoloPokemonClass.POKEMON_CLASS_NORMAL 1 0.699999988079071 6.900000095367432 0.08749999850988388 0.862500011920929 HoloPokemonFamilyId.V0001_FAMILY_BULBASAUR 25
2 120 156 158 HoloPokemonType.POKEMON_TYPE_GRASS HoloPokemonType.POKEMON_TYPE_POISON 0.07999999821186066 0.07000000029802322 0.3187499940395355 0.637499988079071 0.2549999952316284 H
anonymous
anonymous / GAME_MASTER_v0_1.protobuf
Created July 16, 2016 16:31
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {
@eblahm
eblahm / fishyTitle.js
Created October 20, 2015 12:55
Make a 🐟 Swim Across Your Browser Tab
var renderIntervalInMillis = 50;
var characterWidth = 80;
var i = 0;
var whitespace = (new Array(characterWidth)).join('\u205f');
setInterval(function() {
var position = whitespace.length - (i++ % whitespace.length);
document.title = whitespace.substring(0, position) + '🐟' + whitespace.substring(position + 1);
}, renderIntervalInMillis);
@rmkane
rmkane / clock-face.svg
Last active October 9, 2015 15:17 — forked from mbostock/.block
Digital Clock
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rmkane
rmkane / MooToolsTimer.md
Last active August 29, 2015 14:08
Timer and TimerTask written using the MooTools framework.

#MooTools Timer Example

Below is a code snippet that uses the Timer and TimerTask classes.

##Script

function print(id, value) {
    document.getElementById(id).innerHTML = value;
}