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
| <?php | |
| namespace App\Passport; | |
| use App\User; | |
| use Lcobucci\JWT\Builder; | |
| use Lcobucci\JWT\Signer\Key; | |
| use League\OAuth2\Server\CryptKey; | |
| use Lcobucci\JWT\Signer\Rsa\Sha256; | |
| use Laravel\Passport\Bridge\AccessToken as BaseToken; |
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 requireContext = require.context('./', false, /.*\.(js)$/) | |
| let components = {}; | |
| requireContext.keys().forEach(fileName => { | |
| if (fileName === './index.js') return | |
| let name = fileName.replace(/(\.\/|\.js)/g, '') |
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 { Image, Text, View } from 'react-native'; | |
| function renderImage(node: any, output: any, state: any, styles: any) { | |
| const { imageWrapper: wrapperStyle, image: imageStyle } = styles; | |
| /** | |
| * Prevent Native crash (View in Text) from occuring | |
| */ | |
| if (state.inline) { |
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
| client_script { | |
| 'client.lua' | |
| } |
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 { NamingStrategyInterface, DefaultNamingStrategy } from 'typeorm' | |
| import { snakeCase } from 'typeorm/util/StringUtils' | |
| export class SnakeNamingStrategy extends DefaultNamingStrategy implements NamingStrategyInterface { | |
| tableName(className: string, customName: string): string { | |
| return customName ? customName : snakeCase(className) | |
| } | |
| columnName(propertyName: string, customName: string, embeddedPrefixes: string[]): string { | |
| return snakeCase(embeddedPrefixes.join('_')) + (customName ? customName : snakeCase(propertyName)) |
Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.
To learn more about migrations, check out this article on the different types of database migrations!
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
| // This gist explains how to setup scalable Parse LiveQuery server on Heroku | |
| // Because there is one and only 'web' process on Heroku, it will divide into two Heroku apps: Main and LiveQuery. | |
| // A: Main app - All features except for LiveQuery server | |
| // Step A1. Setup a Parse app on Heroku | |
| // Step A2. Add a Heroku Redis (free plan is enough for testing) | |
| // Step A3. Configure Parse app, add redisURL for liveQuery | |
| var api = new ParseServer({ | |
| ... | |
| liveQuery: { |
- http://tools.ietf.org/html/rfc5988
- https://developer.github.com/v3/#pagination
- https://gist.github.com/niallo/3109252
function parse_link_header(header) {NewerOlder