Skip to content

Instantly share code, notes, and snippets.

@abe33
abe33 / remove-twitch-chat-header.js
Created August 10, 2020 12:55
Remove Twitch chat header
function addGlobalStyle(css) {
const style = document.createElement('style');
style.innerHTML = css;
document.head.appendChild(style);
}
addGlobalStyle('.stream-chat .stream-chat-header { display: none !important; }');
function camelize(str) {
return noDiacritics(str)
.toLowerCase()
.split(/[^a-z]+/g)
.reduce(function(memo, s, i) {
return i === 0 ? s : memo + capitalize(s)
}, '');
}
/* Met en majuscule le premier caractère de la chaîne. */
@abe33
abe33 / cool_map_list.py
Last active July 21, 2018 12:03
cool_map_list.py
from random import shuffle
# First thing first, using global should be avoided at all costs, I won't
# explain all the reasons, there's a lot of litterature on that topic.
# So, let's start by removing these globals everywhere and look for
# a way to replace them
# These lists really look like externalities to me, this should problably
# be passed as arguments to the program, or with some other kind of setup,
# but as is, Ill just past them as constant to make it explicit that we won't
@abe33
abe33 / power-level.md
Last active February 22, 2018 17:01
Splatoon Power Level

Power Level and Rank Skip

Let's get this out of the way real quick: We don't really know what accounts for a player's power level. Most likely this is a combination of rank power levels (as described in https://splatoonwiki.org/wiki/Splatfest_Power) with an Elo-based score evolution (as seen in splatfest and leagues) plus another factor that I'll detail later which is more linked to the team-based nature of Splatoon.

The problem here has several faces to it. We need to explain the following elements we can observe daily:

  • How one skips ranks even with cracks when one doesn't with no losses?
  • How the gauge increases differently for apparently random reasons?
  • How one gets cracks instantly and sometimes only after 3 games?

The starting point of my reasoning comes from what we could all see when splatoon was released or, more recently, when clam blitz came out.

const fs = require('fs');
module.exports = {
convertToJson: (filepath, options, callback) => {
callback && fs.readFile(filepath, (err, buf) => {
if (err) { callback(err) }
callback(null, String(buf).split("\n").map(line => {
const [glyph, ruby] = line.split(options.separator);
return { glyph, ruby };
}));
@abe33
abe33 / events.es6
Created February 10, 2017 09:56
Pautay's gist
class Disposable {
constructor (block) {
if (!block) {
throw new Error('A Disposable must be created with a dispose callback')
}
this.block = block
}
dispose () {
if (this.block) {
@abe33
abe33 / compute-line-offsets.cpuprofile
Created March 22, 2016 15:00
Compute Line Offsets
This file has been truncated, but you can view the full file.
@abe33
abe33 / commands.coffee
Last active March 7, 2016 16:42
Minimap Decorations Demo Commands
atom.packages.serviceHub.consume 'minimap', '1.0.0', (minimapAPI) ->
img = new Image()
img.src = 'file:///path/to/tile.png'
routine = (decoration, data) ->
range = decoration.getMarker().getScreenRange()
rowSpan = range.end.row - (range.start.row)
pattern = data.context.createPattern(img, 'repeat')
data.context.fillStyle = pattern#
@abe33
abe33 / abe.itermcolors
Created December 30, 2015 15:23
Iterm setup
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.18021853268146515</real>

Keybase proof

I hereby claim:

  • I am abe33 on github.
  • I am abe33 (https://keybase.io/abe33) on keybase.
  • I have a public key whose fingerprint is B5DD F04C 3132 C101 740F 2755 5BCA E0C4 DEDF 3CF0

To claim this, I am signing this object: