View pinDirectory.js
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
require("dotenv").config(); | |
const fs = require("fs"); | |
const FormData = require("form-data"); | |
var rfs = require("recursive-fs"); | |
const basePathConverter = require("base-path-converter"); | |
const got = require("got"); | |
const pinDirectoryToPinata = async (src) => { | |
const url = `https://api.pinata.cloud/pinning/pinFileToIPFS`; | |
var status = 0; |
View PlanogramsRepository.kt
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
suspend fun syncResults(progress: (message: String) -> Unit) { | |
val directory = resultsDirectory | |
val files = directory.listFiles() | |
if (files.size == 0) return | |
progress("starting results sync") | |
files.map { | |
ioScope.launch { | |
progress("uploading planogram $it") | |
val jsonString = it.readText() |
View YoloObjectDetection.kt
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 YoloObjectDetection private constructor(context: Context) { | |
companion object { | |
@Volatile private var INSTANCE: YoloObjectDetection? = null | |
fun getInstance(context: Context): YoloObjectDetection = | |
INSTANCE ?: synchronized(this) { INSTANCE ?: YoloObjectDetection(context).also { INSTANCE = it}} | |
} | |
} |
View Waveform.js
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 React, { useEffect, useState, useCallback, useRef } from 'react'; | |
import Axios from 'axios'; | |
import WaveformCanvas from './WaveformCanvas'; | |
import Timeline from './Timeline'; | |
import { useAnimationFrame } from '../../helpers/helper'; | |
import { useKeyPress } from '../../hooks/keyPressHooks'; | |
export default function Waveform({ src }) { | |
const audioContextRef = useRef(); | |
const audioBufferRef = useRef(); |
View WaveSurfer.js
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 React, { useEffect, useState, useRef } from "react"; | |
import WaveSurfer from "wavesurfer.js"; | |
import TimeLine from "wavesurfer.js/dist/plugin/wavesurfer.timeline"; | |
import MyTimeLine from "./wavesurfer.markers"; | |
import { useKeyPress } from "./keyPressHooks"; | |
import SoundTouch from "./soundtouch"; | |
const ZOOM_RANGE = { | |
min: 20, | |
max: 200 |
View Service.js
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 React, { useState } from 'react'; | |
import { Form, Header, Segment, Dropdown, Label, Button } from 'semantic-ui-react'; | |
import { Query, Mutation } from 'react-apollo'; | |
import gql from 'graphql-tag'; | |
import MembersSelectionBox from './MembersSelectionBox'; | |
export default ({ id, onSaved }) => { | |
const [name, setName] = useState(); | |
return ( | |
<Segment> |
View docker-compose.yml
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
version: "3" | |
services: | |
server: | |
image: node:8 | |
volumes: | |
- ./:/app | |
working_dir: /app | |
depends_on: | |
- mongo | |
environment: |
View app_v2.js
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 {Animated, Dimensions, NativeModules, Platform, StyleSheet} from 'react-native'; | |
import {formStyle} from './forms'; | |
import {FEED} from './app'; | |
import DeviceInfo from 'react-native-device-info'; | |
import * as config from '../config'; | |
const { StatusBarManager } = NativeModules; | |
const WIDTH = Dimensions.get('window').width; | |
const HEIGHT = Dimensions.get('window').height; |
View Alarm.kt
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
fun setExactAlarm(type: Int, triggerAtMillis: Long, operation: PendingIntent ) { | |
if (Build.VERSION.SDK_INT >= 23) | |
alarmManager.setExactAndAllowWhileIdle(type, triggerAtMillis, operation) | |
else if (Build.VERSION.SDK_INT >= 19) | |
alarmManager.setExact(type, triggerAtMillis, operation) | |
else | |
alarmManager.set(type, triggerAtMillis, operation) | |
} | |
setExactAlarm(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + (1000 * notification.active_after), |
NewerOlder