Skip to content

Instantly share code, notes, and snippets.

View MatthewCallis's full-sized avatar
🍖
Hungry Goriya

Matthew Callis MatthewCallis

🍖
Hungry Goriya
View GitHub Profile

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

Meltdown fix impact on Redis performances in virtualized environments

UPDATE: apparently kernel difference may have a serious impact, so I'll redo the test from scratch.

Test performed with AOF enabled, fsync policy 1 second, allowing the rewrites to be triggered.

Command lines used:

@Madsy
Madsy / build-65816-gas-toolchain.sh
Last active April 2, 2019 19:39
SNES 'lorom' toolchain.
#!/bin/bash
PREFIX=$(HOME)/snes-toolchain
#clone binutils development branch
git clone git://sourceware.org/git/binutils-gdb.git binutils-gdb
cd binutils-gdb
# Checkout a *very* old binutils commit from 2005, as gas support for the coff-w65 target was discontinued a long time ago.
# This version is the best one I found so far.
git checkout 0fdc72dad81fc7f32b898cb408da0300667f728b
@anpage
anpage / sfc2sfrom.py
Last active April 27, 2023 06:58
Scripts to convert SNES ROMs to SNES Classic (.sfrom) format and to read .sfrom headers
#!/usr/bin/env python
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
@yifanlu
yifanlu / vita-dumper-comparsion.md
Last active April 30, 2024 08:40
Vita Dumper Comparison
psvgamesd NoNpDrm Vitamin/MaiDumpTool
Dumps physical games
Dumps digital games, DLC, and updates
Compatible with legit DLC & updates
Saves usable on non-hacked Vitas
All original data untouched ❌❌
No problems saving after suspend ❌❌
Format can be converted to work with other tools
Installs physical games as bubbles
@xmlking
xmlking / docker-compose.yml
Last active March 24, 2023 01:12
cassandra healthcheck and dependency for docker compose
version: '2.1'
services:
cassandra:
image: cassandra:latest
networks:
- reactive-network
volumes:
- cassandra_data:/var/lib/cassandra
# - ${PWD}/data/cassandra/data:/var/lib/cassandra
@iwereth
iwereth / dis6502.c
Created July 12, 2017 06:04
Disassembler 6502
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
static int Disassemble6502Op(unsigned char *codebuffer, int pc)
{
char opstr[256];
uint8_t *opcodes = &codebuffer[pc];
int count = 1;
@jgamblin
jgamblin / slackspotify.sh
Created April 19, 2017 01:10
A Script To Set Current Spotify Song As Slack Status
#!/bin/bash
APIKEY="From Here https://api.slack.com/custom-integrations/legacy-tokens"
SONG=$(osascript -e 'tell application "Spotify" to name of current track as string')
URLSONG=$(echo "$SONG" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"')
while true
do
curl -s -d "payload=$json" "https://slack.com/api/users.profile.set?token="$APIKEY"&profile=%7B%22status_text%22%3A%22"$URLSONG"%22%2C%22status_emoji%22%3A%22%3Amusical_note%3A%22%7D" > /dev/null
sleep 60
done
@Avaq
Avaq / ramda-sanctuary.md
Last active March 1, 2019 00:26
Comprehensive Ramda to Sanctuary list
Ramda Sanctuary
add(a, b) add(b, a)
addIndex(f) ``
adjust(f, i, xs) ``
all(f, xs) ``
allPass(fs, x) allPass(fs, x)
always(x) K(x)
and(a, b) and(a, b)
any(f, x) ``
@nnooney
nnooney / index.html
Created December 31, 2016 01:45
NeDB & Electron & Rollup
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<script src="build.js"></script>
</body>
</html>