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
#!/bin/sh | |
VERSION="$npm_package_version" | |
PLIST_BUDDY="/usr/libexec/PlistBuddy" | |
INFO_PLIST_PATH="./ios/epshpmobileapp/Info.plist" | |
APP_BUILD_GRADLE_PATH="./android/app/build.gradle" | |
# Ensure that PlistBuddy exists and set iOS APPLICATION_NAME | |
if [ -f "$PLIST_BUDDY" ]; then | |
if [ -f "$INFO_PLIST_PATH" ]; then |
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 { useState, useEffect } from 'react'; | |
const isVisible = () => typeof document !== 'undefined' && document.visibilityState === 'visible'; | |
export const useVisible = () => { | |
const [visible, setVisible] = useState(isVisible); // Focus for first render | |
useEffect(() => { | |
setVisible(isVisible()); // Focus for additional renders |
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
package com.noona.application; | |
import android.app.Activity; | |
import android.app.Dialog; | |
import androidx.appcompat.app.AppCompatActivity; | |
import java.lang.ref.WeakReference; | |
public class SplashScreen { |
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
const setItem = (key: string, value: any) => { | |
const payload: any = {}; | |
if (!value) { | |
payload.nullValue = true; | |
} else if (typeof value === 'number') { | |
payload.numberValue = Number(value); | |
} else if (typeof value === 'string') { | |
payload.stringValue = String(value); | |
} else { |
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 faker from 'faker'; | |
import mongo from './mongo'; | |
const [collectionName = 'items', size = 1] = process.argv.slice(2); | |
(async function create() { | |
const db = await mongo(); | |
if (!db) { | |
throw new Error('No database connection'); | |
} |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class BackgroundMusicPlayer : MonoBehaviour | |
{ | |
private AudioSource Empty; | |
private AudioSource PartAAmbience; | |
private AudioSource PartABass; | |
private AudioSource PartAFemaleSinger; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://npmcdn.com/core-js/client/shim.min.js"></script> | |
<script src="https://npmcdn.com/zone.js@0.6.21"></script> | |
<script src="https://npmcdn.com/reflect-metadata@0.1.3"></script> | |
<script src="https://npmcdn.com/rxjs@5.0.0-beta.12/bundles/Rx.min.js"></script> | |
<script src="https://npmcdn.com/@angular/core@2.0.0"></script> | |
<script src="https://npmcdn.com/@angular/common@2.0.0"></script> | |
<script src="https://npmcdn.com/@angular/compiler@2.0.0"></script> |
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
// Use in React components like: | |
// const styles = require('./styles.css'); | |
export default function loader(source, sourceMap) { | |
const newSource = source.replace(/^const +[a-zA-Z]+ += +require\((.*)\.[css|sass|scss|less|styl]\'\);$/gm, input => { | |
const variable = input.split(' ')[1]; | |
const file = input.match(/\(\'(.*)\'\)/)[1]; | |
const output = `import '${file}';` + '\n' + `const ${variable} = require('${file}.json');`; | |
return output; | |
}); |
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 express from 'express'; | |
import { UpdateUserData, ObjectWithId } from 'auth0'; | |
const AUTH0_INVALID_EMAIL_ERROR = `Object didn't pass validation for format email`; | |
const managementClient = new ManagementClient({ | |
domain: process.env.AUTH0_DOMAIN, | |
clientId: process.env.AUTH0_CLIENT_ID, | |
clientSecret: process.env.AUTH0_CLIENT_SECRET, | |
scope: 'read:users create:users update:users' |
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
const fooFn = jest.fn().mockImplementation(() => Promise.resolve('bar')); | |
const barFn = jest.fn(); | |
jest.mock('./foo', () => ({ foo: fooFn, bar: barFn }); | |
import Foo from './foo'; | |
describe('foo module tests', () => { | |
it('runs foo', () => { | |
const foo = Foo(); | |
expect(fooFn).toHaveBeenCalled(); | |
expect(barFn).toHaveBeenCalledTimes(0); |
NewerOlder