Skip to content

Instantly share code, notes, and snippets.

Eloy Durán alloy

Block or report user

Report or block alloy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 1-before-react_redesign.jade.js
(function anonymous(locals, jade
) {
var jade_debug = [ new jade.DebugItem( 1, "/Users/eloy/Code/Artsy/force/src/desktop/components/main_layout/templates/react_redesign.jade" ) ];
try {
var buf = [];
var jade_mixins = {};
var jade_interp;
;var locals_for_with = (locals || {});(function (JSON, Object, asset, assetPackage, body, bodyClass, css, data, defaultOptions, head, helpers, jsonLD, options, scripts, sd, sharify, stitch, styleTags, styledComponents, user, userAgent) {
jade_debug.unshift(new jade.DebugItem( 0, "/Users/eloy/Code/Artsy/force/src/desktop/components/main_layout/templates/redesign.jade" ));
jade_debug.unshift(new jade.DebugItem( 1, "/Users/eloy/Code/Artsy/force/src/desktop/components/main_layout/templates/redesign.jade" ));
@alloy
alloy / steps.sh
Created Sep 11, 2019
Build Swift
View steps.sh
git clone https://github.com/llvm/llvm-project.git
ln -s llvm-project/llvm
ln -s llvm-project/clang
git clone https://github.com/apple/swift-cmark cmark
git clone https://github.com/apple/swift
cd swift
./utils/build-script --release-debuginfo
View 0-base-schema.graphql
# This is just the base schema shared by the two options below.
type User {
name: String
friendships: FriendshipConnection
}
type Friendship {
establishedAt: String
withUser: User
View sigh_modules.md

So here's (part of) the problem:

  • When you use require in Node, Node will look at the closest node_modules and if it can’t find it there look in the parent dir for a node_modules install that has it, until it reaches /.

  • When you ‘link’ npm/yarn do nothing else but create a symlink in your node_modules to the package that presumable lives outside of the tree your app lives in (eg it’s a sibling).

  • Now when your linked package tries to require something and it can’t find it in its own node_modules where should it look? The (real) parent dir isn’t the app, but that’s the default behaviour anyways, so it will fail

  • “But how could that package not be in the linked package’s node_modules?!” you ask, which is a very valid question.

@alloy
alloy / graphql+0.13.2.patch
Last active Apr 20, 2019
relay-compiler v3 clickable error messages
View graphql+0.13.2.patch
patch-package
--- a/node_modules/graphql/error/printError.js
+++ b/node_modules/graphql/error/printError.js
@@ -53,7 +53,7 @@ function highlightSourceAtLocation(source, location) {
var padLen = nextLineNum.length;
var lines = source.body.split(/\r\n|[\n\r]/g);
lines[0] = whitespace(source.locationOffset.column - 1) + lines[0];
- var outputLines = [source.name + ' (' + contextLine + ':' + contextColumn + ')', line >= 2 && lpad(padLen, prevLineNum) + ': ' + lines[line - 2], lpad(padLen, lineNum) + ': ' + lines[line - 1], whitespace(2 + padLen + contextColumn - 1) + '^', line < lines.length && lpad(padLen, nextLineNum) + ': ' + lines[line]];
+ var outputLines = [source.name + ':' + contextLine + ':' + contextColumn, line >= 2 && lpad(padLen, prevLineNum) + ': ' + lines[line - 2], lpad(padLen, lineNum) + ': ' + lines[line - 1], whitespace(2 + padLen + contextColumn - 1) + '^', line < lines.length && lpad(padLen, nextLineNum) + ': ' + lines[line]];
return outputLines.filter(Boolean).join('\n');
View js-to-native.json
{
"type": "many-events",
"events": [{
"type": "event",
"evt": "update",
"data": {
"nodeType": "Native",
"key": null,
"ref": null,
"source": {
View type-emission.html
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Type Emission · Relay</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta name="description" content="&lt;p&gt;As part of its normal work, &lt;code&gt;relay-compiler&lt;/code&gt; will emit type information for your language of choice that helps you write type-safe application code. These types are included in the artifacts that &lt;code&gt;relay-compiler&lt;/code&gt; generates to describe your operations and fragments.&lt;/p&gt;
"/><meta name="docsearch:version" content="next"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="Type Emission · Relay"/><meta property="og:type" content="website"/><meta property="og:url" content="https://facebook.github.io/relay/index.html"/><meta property="og:description" content="&lt;p&gt;As part of its normal work, &lt;code&gt;relay-compiler&lt;/code&gt; will emit type
View stash.patch
commit 519e45328200a0a23b37245bbe198f9d834407bf
Author: Eloy Durán <eloy.de.enige@gmail.com>
Date: Fri Dec 7 00:52:07 2018 +0100
stash more
diff --git a/src/DevTools/createMockNetworkLayer/__tests__/createMockNetworkLayer.test.ts b/src/DevTools/createMockNetworkLayer/__tests__/createMockNetworkLayer.test.ts
index c82aeb5c..7f548964 100644
--- a/src/DevTools/createMockNetworkLayer/__tests__/createMockNetworkLayer.test.ts
+++ b/src/DevTools/createMockNetworkLayer/__tests__/createMockNetworkLayer.test.ts
View workaround-union-bug.diff
diff --git a/src/Apps/Artwork/Components/ArtworkBanner/index.tsx b/src/Apps/Artwork/Components/ArtworkBanner/index.tsx
index c98ee685..42f7ff55 100644
--- a/src/Apps/Artwork/Components/ArtworkBanner/index.tsx
+++ b/src/Apps/Artwork/Components/ArtworkBanner/index.tsx
@@ -13,7 +13,15 @@ export interface ArtworkBannerProps {
}
export const ArtworkBanner: React.SFC<ArtworkBannerProps> = props => {
- const { context, partner } = props.artwork
+ const { auctionContext, fairContext, showContext, partner } = props.artwork
View Media.md

Media React component

TODO: Describe problem and ideally how to avoid using the Media component altogether

  • declerative rather than imperative

API

Setup

You can’t perform that action at this time.