- Typescript
- Output payload type for each status code of endpoint
- Multi-roles per endpoint
- Permissions per endpoint (base permissions provided by role, then extra permissions available)
- Categorize endpoints by roles
- Complete Datadog tracing
- Response of JSON endpoints into datadog (i currently can't see 400 messages for what problems in the fields)
- Log JSON response from endpoints
- ORM nested populate
- ORM find by nested populate critiera
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
| Cu.import('resource://gre/modules/ctypes.jsm'); | |
| const cg = ctypes.open('/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics'); | |
| const CFTimeInterval = ctypes.double; | |
| const CGEventSourceStateID = ctypes.uint32_t; | |
| const CGEventType = ctypes.uint32_t; | |
| const kCGEventSourceStateCombinedSessionState = 0; | |
| const kCGAnyInputEventType = 0xFFFFFFFF; |
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, { | |
| Children, | |
| createContext, | |
| useContext, | |
| useEffect, | |
| useRef, | |
| useState | |
| } from 'react'; | |
| import { |
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, { useCallback, useEffect, useRef } from 'react';import { defaults, omit, pick } from 'lodash'; | |
| import { useController, UseControllerProps } from 'react-hook-form'; | |
| import { TextInput, TextInputProps } from 'react-native';import { HookedInputTransformer } from 'src/lib/react-hook-form-transforms';interface HookedTextInputProps | |
| extends Omit<TextInputProps, 'defaultValue'>, | |
| UseControllerProps { | |
| transform?: HookedInputTransformer; | |
| }export default function withHookedInput( | |
| ControlledInputComponent: typeof TextInput | |
| ) { | |
| function HookedInput({ transform, ...props }: HookedTextInputProps) { |
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 { Text, View, StyleSheet, TextInput, Button, Alert } from 'react-native'; | |
| import { useForm, useController } from 'react-hook-form'; | |
| import Constants from 'expo-constants'; | |
| import { pick, omit, defaults } from 'lodash'; | |
| const REQUIRED = { required: true }; | |
| function ClassicHookedTextInput(props) { | |
| const controllerProps = defaults( |
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
| var { stripIndents } = require("common-tags") | |
| const toTitle = ad => ad.title; | |
| const ads = [{ title: 'a' }, { title: 'b' }]; | |
| function bulletLists(strs, ...lists) { | |
| return strs.reduce((compiled, str, ix) => { | |
| compiled.push(str); | |
| const list = lists[ix]; | |
| if (list) { |
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 useRenderCounter(label) { | |
| const ref = React.useRef(); | |
| React.useEffect(() => { | |
| ref.current.textContent = [ | |
| parseInt(ref.current.textContent || "0", 10) + 1, | |
| label | |
| ] | |
| .filter(Boolean) | |
| .join(" - "); | |
| }); |
// get utc of Feb2 2021 10am in New York - moment.tz('America/New_York').month(1).date(2).hour(10).minute(0).second(0).valueOf()
// now with the return of the above is Date.now() as if i ran it in New York timezone on Feb2 2021 10am - so doing moment.utc(1612278000203).tz('America/New_York').format('llll') gives 'Tue, Feb 2, 2021 10:00 AM'
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
| ///////// | |
| var chunk_cnt = 0; | |
| var upload = function() { | |
| // /{user-id}/feed?message={message}&access_token={access-token} | |
| aReportProgress({ | |
| body_prefix: 'Chunk ' + (++chunk_cnt) + ' - ', | |
| reason: formatStringFromName('uploading_init', 'app') | |
| }); |
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 { routes } = require('../../../config/routes'); | |
| const pluralize = require('pluralize'); | |
| const { camelCase } = require('lodash'); | |
| /** | |
| * implicitRoutes hook | |
| * | |
| * | |
| * @description :: A hook definition. Extends Sails by adding shadow routes, implicit actions, and/or initialization logic. | |
| * @docs :: https://sailsjs.com/docs/concepts/extending-sails/hooks |