This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
/* imports ... */ | |
import { pick } from 'lodash'; | |
class Form extends ModuleForm { | |
fields: FieldsDefinitions = { | |
id: 'none', | |
email: 'none', | |
picture_path: { | |
type: 'image', transformations: 'h_200,w_200,r_max,c_fill' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface BasicUserFragment { | |
id: string, | |
first_name: string, | |
last_name: string, | |
username: string | null, | |
picture_path: string | null, | |
active: boolean, | |
portfolio_id: string | null, | |
job_title: string | null, | |
email: string, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FindProxyForURL(url, host) { | |
// If the hostname matches, use proxy. | |
if ( | |
shExpMatch(host, "*.aline.work") || | |
shExpMatch(host, "aline.work") || | |
shExpMatch(host, "*.ipify.org") | |
) { | |
return "PROXY xx.xx.xx.xx:8888"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// without TypeScript | |
import PropTypes from 'prop-types'; | |
class Greeting extends React.Component { | |
render() { | |
return ( | |
<h1>Hello, {this.props.name}</h1> | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"anonymousId": "<removed>", | |
"context": { | |
"library": { | |
"name": "analytics.js", | |
"version": "3.2.5" | |
}, | |
"page": { | |
"path": "<removed>", | |
"referrer": "<removed>", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloLink, NextLink, Operation } from 'apollo-link'; | |
import { JasonBourne } from '../../../service/Marketing/JasonBourne'; | |
const PERF_MONITORED_OPERATIONS = [ | |
'loadChatsList', | |
// ... | |
]; | |
export const perfMonitorLink = new ApolloLink((operation: Operation, forward?: NextLink) => { | |
const startTime = new Date().getTime(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.handler = (event, context, callback) => { | |
var AWS = require('aws-sdk'); | |
AWS.config.update({region: 'eu-west-1'}); // configure region | |
const athena = new AWS.Athena(); | |
athena.getNamedQuery({ NamedQueryId: '<your-query-id>' }, function(err, data) { | |
console.log('getNamedQuery', err, data); | |
if (!err) { | |
var params = { | |
QueryString: data.NamedQuery.QueryString, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NetworkStatus, isNetworkRequestInFlight } from 'apollo-client/core/networkStatus'; | |
type isNetworkTransitionArg = { | |
networkStatus: NetworkStatus; | |
}; | |
export enum NetworkTransition { | |
LOADED_DATA, | |
WAS_IN_CACHE, | |
LOADING, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Person { | |
id: string; | |
name: string; | |
} | |
function sayHello(person: Person) { | |
console.log(person.name); | |
} | |
sayHello({} as any); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hash | |
# {'x'=>{'y'=>{'z'=>1,'a'=>2}}}.leaves == [1,2] | |
def leaves | |
leaves = [] | |
each_value do |value| | |
if value.is_a?(Hash) | |
value.leaves.each{|l| leaves << l } | |
elsif value.is_a?(Array) | |
value.each{|l| leaves << l } |