Skip to content

Instantly share code, notes, and snippets.

View guatedude2's full-sized avatar

Alejandro Gonzalez Sole guatedude2

View GitHub Profile
@szalishchuk
szalishchuk / ip.js
Last active December 14, 2022 11:04
Get local external ip address with nodejs
var
// Local ip address that we're trying to calculate
address
// Provides a few basic operating-system related utility functions (built-in)
,os = require('os')
// Network interfaces
,ifaces = os.networkInterfaces();
// Iterate over interfaces ...
@lovegrovegeorge
lovegrovegeorge / apollo.js
Created May 22, 2018 10:21
React Native Apollo client setup
import { createHttpLink } from 'apollo-link-http'
import { ApolloLink, split, concat } from 'apollo-link'
import { ApolloClient } from 'apollo-client'
import { WebSocketLink } from 'apollo-link-ws'
import { getMainDefinition } from 'apollo-utilities'
import { InMemoryCache } from 'apollo-cache-inmemory'
import { onError } from 'apollo-link-error'
import { withClientState } from 'apollo-link-state'
import env from '../env.json'