This file contains hidden or 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
WITH initial_price as ( | |
SELECT transaction_hash, | |
index, | |
blocks.number as block_number, | |
blocks.timestamp as block_timestamp, | |
sqrt_ratio as sqrt_ratio_after | |
FROM initializations | |
JOIN blocks ON initializations.block_number = blocks.number | |
WHERE pool_key_hash = 3444297103257838275074422089987936420839083129914207634282919550416207684544 | |
), |
This file contains hidden or 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
// Peer 1 | |
pc.createOffer( | |
offer => { | |
pc.setLocalDescription( | |
offer, | |
() => { | |
// send the offer sdp to the other peer | |
}, | |
e => console.log(e), | |
) |
This file contains hidden or 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 DisplayStream extends React.Component { | |
state = { | |
localstream: null, | |
} | |
componentDidMount() { | |
export const iceServers = [ | |
{ url: 'stun:stun.l.google.com:19302' }, | |
{ url: 'stun:stun01.sipphone.com' }, | |
{ url: 'stun:stun.ekiga.net' }, |
This file contains hidden or 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
MediaStreamTrack.getSources((sourceInfos)) => { | |
console.log('MediaStreamTrack.getSources', sourceInfos) | |
let videoSourceId | |
for (let i = 0; i < sourceInfos.length; i++) { | |
const sourceInfo = sourceInfos[i] | |
if (sourceInfo.kind === 'video' && sourceInfo.facing === 'front') { | |
videoSourceId = sourceInfo.id | |
} | |
} | |
getUserMedia( |
This file contains hidden or 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 const iceServers = [ | |
{ url: 'stun:stun.l.google.com:19302' }, | |
{ url: 'stun:stun01.sipphone.com' }, | |
{ url: 'stun:stun.ekiga.net' }, | |
{ url: 'stun:stun.fwdnet.net' }, | |
{ url: 'stun:stun.ideasip.com' }, | |
{ url: 'stun:stun.iptel.org' }, | |
{ url: 'stun:stun.rixtelecom.se' }, | |
{ url: 'stun:stun.schlund.de' }, | |
{ url: 'stun:stun.l.google.com:19302' }, |
This file contains hidden or 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' | |
import { Animated, Easing, StatusBar, MaskedViewIOS, View, ViewStyle } from 'react-native' | |
import icons from '../../icons' | |
import lightTheme from '../../config/theme' | |
interface Props { | |
bootstraped: boolean | |
} | |
const AnimatedGate: React.FunctionComponent<Props> = (props) => { |
This file contains hidden or 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
// Generics type & interface | |
type HasGeneric<T> = { | |
genericType: T, | |
nonGenericType: string, | |
arrayGeneric: Array<T>, | |
} | |
interface GenericsInterface<T> { | |
genericType: T; |
This file contains hidden or 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 that executes a action and dont receive any params and returns void | |
type ChangesSomething = () => void | |
// Function that receives a string and returns a string | |
type FormatName = (name: string) => string | |
// Function that checks if a string is null and returns a boolean | |
type CheckNull = (value: string) => boolean | |
// Function that sums two numbers and returns a number |
This file contains hidden or 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 User { | |
username: string; | |
email: string; | |
password: string; | |
} | |
// So here we cant user the & operator after extends to compose types | |
// So if you want to extend more than one interface or type you need to use type | |
interface Compose extends User { |
This file contains hidden or 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
// working with pipes and type | |
type Fruit = "orange" | "banana" | "strawberry"; | |
// working with types and functions | |
type EatFruitFunction = (fruit: Fruit) => void; | |
// typing objects using type | |
type User = { | |
username: string, | |
email: string, |
NewerOlder