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
| primes = [] | |
| findNextPrime = -> | |
| len = primes.length | |
| pr = primes[len - 1] or 1 | |
| loop | |
| pr += if len > 2 then 2 else 1 | |
| divides = false | |
| i = 0 | |
| # discard the number if it divides by one earlier prime. |
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 stampit from 'stampit'; | |
| import EventEmitter from 'events'; | |
| const EventEmittable = stampit({ | |
| initializers: function initEventEmitter() { | |
| Reflect.apply(EventEmitter, this, []); | |
| }, | |
| methods: ['emit', 'on', 'once', 'removeListener'].reduce((methods, methodName) => { | |
| methods[methodName] = EventEmitter.prototype[methodName]; | |
| return methods; |
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
| Arguments: | |
| C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\yarn\bin\yarn.js add blackdice/errorception | |
| PATH: | |
| C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;D:\users\DarkMaster\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft\Web Platform Installer\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;%NVM_HOME%;%NVM_SYMLINK%;C:\Program Files\Git\cmd;D:\users\DarkMaster\AppData\Local\Programs\Git\cmd;D:\users\DarkMaster\AppData\Local\Microsoft\WindowsApps;D:\users\DarkMaster\AppData\Roaming\nvm;C:\Program Files\nodejs | |
| Yarn version: | |
| 0.17.0 | |
| Node version: |
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
| { | |
| "name": "test", | |
| "version": "1.0.0", | |
| "main": "index.js", | |
| "license": "MIT", | |
| "dependencies": { | |
| "async": "0.9.0", | |
| "babel-core": "6.18.0", | |
| "babel-plugin-react-require": "3.0.0", | |
| "babel-preset-es2015": "6.18.0", |
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 functions = require('firebase-functions') | |
| const admin = require('firebase-admin') | |
| // This is hosted using Firebase Functions to gain easier access without meddling with service key | |
| admin.initializeApp(functions.config().firebase) | |
| exports.verifyToken = functions.https.onRequest((req, res) => { | |
| const { idToken } = req.query | |
| if (!idToken) { |
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 React from 'react'; | |
| import { StyleSheet, Text, View } from 'react-native'; | |
| import { Util } from 'expo' | |
| export default class App extends React.Component { | |
| state = { | |
| updated: false, | |
| } | |
| componentWillMount() { | |
| Util.addNewVersionListenerExperimental(() => { |
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 { types } from 'mobx-state-tree' | |
| const SECOND = 1 * 1000 | |
| const MINUTE = 60 * SECOND | |
| export const TimingModel = types | |
| .model('Timing', { | |
| bySecond: types.optional(types.number, Infinity), | |
| byMinute: types.optional(types.number, Infinity), | |
| autoStart: false, |
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
| declare module 'mobx-react-form' { | |
| export default MRF.MobxReactForm | |
| } | |
| type Dictionary<T> = { [key: string]: T } | |
| declare namespace MRF { | |
| class MobxReactForm { | |
| constructor(options: MRF.Options, settings?: MRF.Settings) | |
| isValid: boolean |
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 { ApolloQueryResult } from 'apollo-client' | |
| import { DocumentNode } from 'graphql' | |
| import React from 'react' | |
| import { graphql } from 'react-apollo' | |
| import { MutationFunc, MutationOpts } from 'react-apollo/types' | |
| interface IQueryProps<TResult, TVariables = {}> { | |
| render( | |
| execute: (variables?: Partial<TVariables>) => Promise<TResult>, | |
| executionOptions?: MutationOpts<TVariables>, |
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 { Trans } from '@lingui/react' | |
| import React, { Children } from 'react' | |
| interface IProps { | |
| children: ReactNode | string | |
| } | |
| interface IState { | |
| refs: React.RefObject<Trans>[] |
OlderNewer