Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Elie elie222

🏠
Working from home
Block or report user

Report or block elie222

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
@elie222
elie222 / Items.tsx
Created Aug 18, 2019
Using GraphQL code generator
View Items.tsx
import React from 'react'
import { Text, View, TouchableOpacity, ImageBackground, ScrollView } from 'react-native'
import gql from 'graphql-tag'
import { FlatGrid } from 'react-native-super-grid'
import { useItemsQuery } from '../../generated/graphql'
export const ITEMS_QUERY = gql`
query Items($communityId: String!) {
items(communityId: $communityId) {
_id
View BikeEntity.ts
import { Field, ObjectType, ID } from 'type-graphql'
import {
Entity,
ObjectIdColumn,
ObjectID,
Column,
CreateDateColumn,
UpdateDateColumn,
} from 'typeorm'
@elie222
elie222 / sanctuary.d.ts
Created Aug 14, 2019
Sanctuary TS types
View sanctuary.d.ts
declare module 'sanctuary' {
type maybeToNullable<A> = (p: Maybe<A>) => Nullable<A>;
type Nullable<A> = A | null;
type Pair<A, B> = [A, B];
type Thunk<A> = () => A;
type Fn<A, B> = (a: A) => B;
@elie222
elie222 / my-vs-code-snippets.json
Last active Jul 28, 2019
Favourite VS Code Snippets
View my-vs-code-snippets.json
{
"Export default": {
"scope": "javascript,typescript,javascriptreact,typescriptreact",
"prefix": "eid",
"body": [
"export { default } from './${TM_DIRECTORY/.*[\\/](.*)$$/$1/}'",
"$2"
],
"description": "Import and export default in a single line"
},
@elie222
elie222 / Policy.ts
Created Apr 10, 2019
Using TypeORM (MongoDB) and TypeGraphQL together
View Policy.ts
import { Field, ObjectType, ID } from 'type-graphql'
import {
Entity,
ObjectIdColumn,
ObjectID,
Column,
CreateDateColumn,
UpdateDateColumn,
} from 'typeorm'
@elie222
elie222 / EditableTitle.tsx
Created Feb 24, 2019
Strange span behaviour
View EditableTitle.tsx
import * as React from 'react'
import styled from 'styled-components'
const Container = styled.div<{ light?: boolean }>`
display: inline-block;
/* when using inline-block and overflow: hidden the text rises unless using v align bottom */
vertical-align: bottom;
margin-left: 8px;
font-size: 18px;
max-width: 280px;
View gist:195f4dabc3b5c120b22c5cd7b08f8d16
yarn link # in the root of the forked package
yarn link package-name # in the root of your project
@elie222
elie222 / Call.tsx
Created Feb 7, 2019
Using 'react-responsive-modal' with 'react-confirm'
View Call.tsx
dialogConfirm('Are you sure you would like to delete this item?', {
title: 'Delete item',
confirmText: 'Delete',
red: true,
}).then(
() => {
// delete item
console.log('delete item')
},
() => {
@elie222
elie222 / withClickOutside.tsx
Created Jan 24, 2019
HOC for closing an item when clicked outside. Useful for dropdowns and tooltips
View withClickOutside.tsx
import * as React from 'react'
import hoistNonReactStatic from 'hoist-non-react-statics'
import { findDOMNode } from 'react-dom'
export interface WithClickOutsideProps {
close: () => void
containerElement?: React.RefObject<any>
}
const withClickOutside = <P extends WithClickOutsideProps>(
@elie222
elie222 / README.md
Last active Sep 19, 2017
Deploying Mup to a single server
View README.md

And then you want to run the following command after deploy:

ssh -i ~/.ssh/mypem.pem username@ip /home/myapp/rebuild-restart-mup-my-app.sh

Or stick it in the Meteor Up post deploy hook:

  hooks: {
    'post.deploy': {
      localCommand: 'ssh -i ~/.ssh/mypem.pem username@ip /home/myapp/rebuild-restart-mup-my-app.sh',
You can’t perform that action at this time.