Skip to content

Instantly share code, notes, and snippets.

View FireyFly's full-sized avatar

FireFly FireyFly

View GitHub Profile
(function() {
'use strict';
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = {
checkDCE: function() {},
supportsFiber: true,
roots: new Set(),
inject() {},
onCommitFiberRoot(rendererID, root) {
const current = root.current;
if (current.memoizedState != null && current.memoizedState.element != null) {
@derhuerst
derhuerst / _.md
Created March 22, 2019 13:59
strecken.info HAFAS JS code
Hafas.Texts.himPriorities = {
'2' : 'Ausfall'
,'8' : 'Teilausfall'
,'16' : 'Zurückhalten von Zügen'
,'23' : 'Umleitung'
,'24' : 'Totalsperrung'
,'25' : 'Streckenruhe'
,'37' : 'Fahren auf dem Gegengleis mit Zs 8 oder Befehl'
,'60' : 'Umleitung unter erleichterten Bedingungen'
@LisannaAtHome
LisannaAtHome / help.md
Last active April 30, 2022 12:43
Lisanna's eclectic nix troubleshooting guide for suicidal power users

Lisanna's eclectic nix troubleshooting guide for suicidal power users

tar fails with exit code 1

unpacking 'https://example.com/nixexprs.tar.xz'...
tar: Error opening archive: Failed to open '/nix/store/411sszfqfya5ad2wllmqcr15z5d30575-nixexprs.tar.xz'
error: program 'tar' failed with exit code 1

Discussion:

@hallettj
hallettj / HKT.js
Last active June 27, 2019 15:19
Concept for emulating higher-kinded types in Flow via type-level functions
/*
* Concept for emulating higher-kinded types using Flow. Instead of passing
* a type that has not been applied to parameters, this pattern passes
* a type-level function that will map a parameter type to the desired
* higher-kinded type applied to the given parameter.
*
* @flow
*/
// a higher-kinded type is represented indirectly via a type-level function from

Index

Preface

Together with HellMood we won this year's (2016) JS1K competition and thought this might be a good opportunity to write about the development process and my motivation behind it. If you're already familiar with JS1K, feel free to skip the next two paragraphs.

@sebble
sebble / stars.sh
Last active May 17, 2024 20:59
List all starred repositories of a GitHub user.
#!/bin/bash
USER=${1:-sebble}
STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-)
PAGES=$((658/100+1))
echo You have $STARS starred repositories.
echo
@avafloww
avafloww / PhpJava.java
Last active October 16, 2022 18:50
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@hallettj
hallettj / adt.js
Last active March 21, 2019 12:56
Proposed implementation of GADTs with Javascript and Flow
/*
* `match` is a helper function for writing pattern matches on types that are
* implemented using Scott encoding.
*
* @flow
*/
export function match<A,B>(matcher: A): (match: (matcher: A) => B) => B {
return match => match(matcher)
}
@subfuzion
subfuzion / http-status-codes.md
Last active September 3, 2023 09:15
General REST API HTTP Status Codes

Reference: RFC 2616 - HTTP Status Code Definitions

General

  • 400 BAD REQUEST: The request was invalid or cannot be otherwise served. An accompanying error message will explain further. For security reasons, requests without authentication are considered invalid and will yield this response.
  • 401 UNAUTHORIZED: The authentication credentials are missing, or if supplied are not valid or not sufficient to access the resource.
  • 403 FORBIDDEN: The request has been refused. See the accompanying message for the specific reason (most likely for exceeding rate limit).
  • 404 NOT FOUND: The URI requested is invalid or the resource requested does not exists.
  • 406 NOT ACCEPTABLE: The request specified an invalid format.
@jashank
jashank / README.md
Last active March 20, 2019 19:31
RFC 1345 compose keys

RFC 1345 Compose Keys

The notion of Compose keys are brilliant. I really like the notion of pressing a key, typing a sequence of characters, and out pops a pretty Unicode character. However, the default sequences in X are immensely silly, and in any case, there's already an RFC for this.

RFC 1345 exists to specify a simple way of entering Unicode characters, and it's a crying shame that Compose keys don't use it,