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 { Skia } from "@shopify/react-native-skia"; | |
export const createGraphPath = ( | |
width: number, | |
height: number, | |
steps: number, | |
round = true | |
) => { | |
const retVal = Skia.Path.Make(); | |
let y = height / 2; |
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(){ | |
'use strict'; | |
var player = {"id":"6f3c055","name":"Default","type":"classic","size":"large","stream":{"station ":"s307b15171","output":null,"streaming_url":"https:\/\/streaming.radio.co\/s307b15171"},"theme":{"width":400,"background_colour":"#efefef","text_colour":"#de000a","accent_colour":"#9f9f9f","rounded_corners":true,"track_information":true},"settings":{"autoplay":true,"artwork":true,"spotify":false,"popout":false},"embed_url":"https:\/\/embed.radio.co\/player\/6f3c055.html","social":{"twitter":true,"facebook_share":true,"embed":true,"template":"Chilled.io"}}; | |
var i = document.createElement('iframe'); | |
var style = "border: none;overflow:hidden;"; | |
var width = player.theme.width; | |
i.src = player.embed_url; | |
i.width = '100%'; |
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
console.log('Hello world'); |
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
/** | |
* Copyright (c) Facebook, Inc. and its affiliates. | |
* | |
* This source code is licensed under the MIT license found in the | |
* LICENSE file in the root directory of this source tree. | |
* | |
* @flow | |
*/ | |
/** |
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
const INC = 'increment'; | |
const DEC = 'decrement'; | |
const RES = 'reset'; | |
const ADD = 'add'; | |
function createStore(rootReducer, initialStore) { | |
let store = initialStore; | |
let subscribers = []; |
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
if (pm.response.code === 201) { | |
pm.environment.set('authToken', pm.response.json().token); | |
} |
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
console.log(new Error().stack); | |
// example | |
function firstFunction() { | |
secondFunction(); | |
} | |
function secondFunction() { | |
thridFunction(); | |
} | |
function thridFunction() { | |
console.log(new Error().stack); |
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
// Each boolean and number variable takes 8 bytes of memory. | |
var counter = 0; | |
try { | |
function foo() { | |
counter += 1; | |
foo(); | |
} | |
foo(); | |
} catch(e) { | |
console.error(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
normalizeAngle = angle => { | |
let newAngle = angle; | |
if (newAngle <= -180) newAngle += 360; | |
if (newAngle > 180) newAngle -= 360; | |
return newAngle; | |
}; | |
calculateAngle = point => { | |
return (Math.atan2(point.y - INITIAL_POINT.y, point.x - INITIAL_POINT.x) * 180 / Math.PI) + 90; | |
}; |
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
cloneObject = obj => { | |
const clone = {}; | |
for(let i in obj) { | |
if(obj[i] != null && typeof(obj[i]) === "object") { | |
clone[i] = this.cloneObject(obj[i]); | |
} else { | |
clone[i] = obj[i]; | |
} | |
} | |
return clone; |
NewerOlder