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. */

My Atom Config

Atom Editor Screenshot

Community Packages
├── Stylus@3.1.0
├── Zen@0.16.4
├── atom-eco@0.2.0
├── atom-material-syntax@0.4.6
@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 / init.coffee
Last active May 1, 2018 21:44
Scrolling Atom editors without moving the cursor
atom.commands.add 'atom-text-editor',
'editor:scroll-down': ->
editor = atom.workspace.getActiveTextEditor()
editorElement = atom.views.getView(editor)
newScrollTop = editorElement.getScrollTop() + editorElement.getHeight()
editorElement.setScrollTop(newScrollTop)
'editor:scroll-up': ->
editor = atom.workspace.getActiveTextEditor()
editorElement = atom.views.getView(editor)
@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.
{"head":{"functionName":"(root)","scriptId":"0","url":"","lineNumber":0,"columnNumber":0,"hitCount":0,"callUID":373,"children":[{"functionName":"","scriptId":"147","url":"/Users/cedric/github/atom/src/window-event-handler.coffee","lineNumber":3,"columnNumber":47,"hitCount":0,"callUID":17,"children":[{"functionName":"module.exports.WindowEventHandler.handleDocumentKeyEvent","scriptId":"147","url":"/Users/cedric/github/atom/src/window-event-handler.coffee","lineNumber":97,"columnNumber":67,"hitCount":0,"callUID":16,"children":[{"functionName":"module.exports.KeymapManager.handleKeyboardEvent","scriptId":"174","url":"/Users/cedric/github/atom/node_modules/atom-keymap/lib/keymap-manager.js","lineNumber":324,"columnNumber":59,"hitCount":1,"callUID":15,"children":[{"functionName":"module.exports.KeymapManager.dispatchCommandEvent","scriptId":"174","url":"/Users/cedric/github/atom/node_modules/atom-keymap/lib/keymap-manager.js","lineNumber":561,"columnNumber":60,"hitCount":0,"callUID":12,"children":[{"functionName":
@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#