Skip to content

Instantly share code, notes, and snippets.

View jbreckmckye's full-sized avatar
💽

Jimmy Breck-McKye jbreckmckye

💽
View GitHub Profile

Cheat sheet: JavaScript Array methods

Deriving a new Array from an existing Array:

['■','●','▲'].slice(1, 3)           ['●','▲']
['■','●','■'].filter(x => x==='■')  ['■','■']
    ['▲','●'].map(x => x+x)         ['▲▲','●●']
    ['▲','●'].flatMap(x => [x,x])   ['▲','▲','●','●']
@obskyr
obskyr / X-MAS CTF 2020 – Ken Kutaragi's Secret Code.md
Created December 20, 2020 02:53
How to Reverse-Engineer a PS1 Game – X-MAS CTF 2020 Writeup

X-MAS CTF 2020 Writeup: Ken Kutaragi's Secret Code

Or, How to Reverse-Engineer a PS1 Game

X-MAS CTF 2020 was my first CTF – I do ROM hacking, fan translation, and hardware modding, but I haven't done much hacking related to modern systems, so I was a wee bit worried there wouldn't be many challenges suited to my skillset. Imagine my surprise and delight, then, when I saw the challenge Ken Kutaragi's Secret Code, which consists of a PlayStation executable! And wouldn't you know it? I've hacked away at quite a few PS1 games in my day! Not many people solved it, likely because it requires quite niche skills – so let me share those with you!


Identifying our goal

The challenge description is as follows.

@JulianG
JulianG / createStrictContext.js
Created August 9, 2020 14:07
Create React Strict Context
import React from 'react';
export function createStrictContext(options = {}) {
const Context = React.createContext(undefined);
Context.displayName = options.name;
function useContext() {
const context = React.useContext(Context);
if (!context) {
throw new Error(options.errorMessage || `${name || ''} Context Provider is missing`);
}
@MichaelCurrin
MichaelCurrin / README.md
Last active December 1, 2025 08:50
GitHub GraphQL - Get Pull Requests using GH's GraphQL API

Get Pull Requests using GH's GraphQL API

How to get Pull Requests data using GitHub in the browser, or using the API to allow for automating reporting or building in values into a website.

Resources

author title
Lionel Flandrin
Playstation Emulation Guide

Introduction

This is my attempt at documenting my implementation of a PlayStation

import { createHash, randomBytes } from 'crypto';
import * as request from 'request';
/**
* The configuration object
*
* @export
* @interface IAuthServiceConfig
*/
export interface IAuthServiceConfig {
@adeperio
adeperio / AuthService.js
Last active January 8, 2022 20:06
PKCE flow in Electron with Passwordless. In ES6 + flow + request-promise. Executes PKCE through the Electron BrowserWindow
//@flow
import request from 'request'
import crypto from 'crypto'
import rp from 'request-promise'
export type AuthServiceConfig = {
authorizeEndpoint: string,
clientId: string,
audience: string,
scope: string,
  • The benchmarks used by Marko, with one benchmark containing only a single component with ~50 lines of code, and the other 3 components with one of them fully static markup, are typical micro-benchmarks created to the advantage of certain implementation details. They are too isolated and too trivial to justify across-the-board performance claims.

  • For client-side performance I recommend using the 3rd party js-framework-benchmark as a more neutral reference; the benchmark tests a much bigger workload and covering a much more comprehensive performance scenarios. According to the data from the latest round Vue actually outperforms Marko. That said, even this benchmark doesn't reflect real world performance where much more overhead comes from big component trees.

  • Vue has significantly improved SSR performance for

@kl0tl
kl0tl / raven.js
Created December 15, 2016 13:39
Load Raven async
(function (global, document, url) {
var calls = [];
var spy = {};
var methods = ['config', 'install', 'setUserContext', 'captureException'];
for (var i = 0, method; method = methods[i]; i += 1) {
spy[method] = (function (name) {
return function () {
calls.push([name, arguments]);
return this;
@JamieMason
JamieMason / .babelrc
Created December 5, 2016 08:41
Tree-Shaking with Babel 6, Webpack 2, and React.
{
"presets": [
["es2015", {
"es2015": {
"loose": true,
"modules": false
}
}], "react"
]
}