Skip to content

Instantly share code, notes, and snippets.

View sibelius's full-sized avatar
🦈
give me a feedback https://entria.feedback.house/sibelius

Sibelius Seraphini sibelius

🦈
give me a feedback https://entria.feedback.house/sibelius
View GitHub Profile
@sibelius
sibelius / programming-as-theory-building.md
Created January 2, 2024 20:16 — forked from onlurking/programming-as-theory-building.md
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

diff --git a/node_modules/jest-runtime/build/index.js b/node_modules/jest-runtime/build/index.js
index 0c9dd8c..58109b5 100644
--- a/node_modules/jest-runtime/build/index.js
+++ b/node_modules/jest-runtime/build/index.js
@@ -1189,7 +1189,38 @@ class Runtime {
return this._getMockedNativeModule();
}
- return require(moduleName);
+ // return require(moduleName);
@sibelius
sibelius / babel.config.js
Created April 26, 2020 14:31 — forked from jgcmarins/babel.config.js
Webpack configs for Node.js backends to run both locally and on AWS Lambda
module.exports = {
presets: [
'@babel/preset-react',
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
@sibelius
sibelius / App.js
Created August 20, 2019 20:55 — forked from BorisTB/App.js
Demo of helper hooks for automatic refetch on sort/pagination change
const App = React.memo(
({
node: {
items: { totalCount, ...items }
},
relay
}) => {
const [fulltext, setFulltext] = useState('')
const fulltextDebounced = useDebounce(fulltext, 300)
const [{ sort, order }, updateSort] = useSort({ sort: 'name', order: 'asc' })
type XYChartData {
x: Float!
y: Float!
label: String
}
type BarChart {
title: String
data: [XYChartData!]!
}
@sibelius
sibelius / Dockerfile
Created April 21, 2019 16:40 — forked from armand1m/Dockerfile
Yarn cache compatible Dockerfile
FROM alpine
RUN apk add --update --no-cache nodejs
RUN npm i -g yarn
ADD package.json yarn.lock /tmp/
ADD .yarn-cache.tgz /
RUN cd /tmp && yarn
RUN mkdir -p /service && cd /service && ln -s /tmp/node_modules
@sibelius
sibelius / component.js
Created March 7, 2019 17:58 — forked from elsangedy/component.js
i18next
t('global_datetime_formatter', { date: myDate })
t('global_currency_formatter', { value: myValue })
@sibelius
sibelius / createFragmentContainer.js
Created February 14, 2019 02:02 — forked from nickhudkins/createFragmentContainer.js
Data Masking with Apollo / GraphQL Anywhere
import React from 'react';
import { filter } from 'graphql-anywhere';
import hoistNonReactStatic from 'hoist-non-react-statics';
/*
* createFragmentContainer returns a component which expects props that match
* WrappedComponent's fragment names, and provides data masking
*/
export default function createFragmentContainer(WrappedComponent) {
@sibelius
sibelius / environment.js
Created July 23, 2018 18:23 — forked from wbyoung/environment.js
Relay environment while exploring deferred queries
/* @flow */
import {
forOwn,
size,
get,
transform,
noop,
} from 'lodash';
type TypesDefinition =
| StringConstructor
| BooleanConstructor
| DateConstructor
type FieldDefinition = {
type: TypesDefinition,
required?: boolean,
default?: boolean,
}