This is a test for devgrid!
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: | |
postgres: | |
image: postgres:11.2-alpine | |
environment: | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_USER: postgres | |
ports: | |
- "5432:5432" | |
volumes: |
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 bcrypt = require("bcrypt") | |
const SALT_ROUNDS = 10 | |
async function hash(password) { | |
const salt = await bcrypt.genSalt(SALT_ROUNDS) | |
const hashed = await bcrypt.hash(password, salt) | |
return hashed | |
} | |
async function compare(password, hashed) { |
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 } from 'react' | |
import { Keyboard, TextInput, UIManager, Platform } from 'react-native' | |
const AndroidKeyboardView = () => { | |
return null | |
} | |
const IOSKeyboardView = props => { | |
const [keyboardInfo, setKeyboardInfo] = useState(0) | |
const [keyboardDidShowEvent, setKeyboardDidShowEvent] = useState(null) |
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
var db = mongoose.connect('mongodb://localhost:27017/DB'); | |
// In middleware | |
app.use(function (req, res, next) { | |
// action after response | |
var afterResponse = function() { | |
logger.info({req: req}, "End request"); | |
// any other clean ups |
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
# Logs | |
logs | |
*.log | |
npm-debug.log* | |
yarn-debug.log* | |
yarn-error.log* | |
# Runtime data | |
pids | |
*.pid |
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
public class KeyboardHelper | |
{ | |
private UIViewController _viewController; | |
private UIScrollView _scrollView; | |
public KeyboardHelper(UIViewController viewController) | |
{ | |
this._viewController = viewController; | |
} |
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 Foundation | |
import UIKit | |
extension UIView { | |
func bindToKeyboard() { | |
NotificationCenter.default.addObserver(self, selector: #selector(UIView.keyboardWillChange(_:)), name: NSNotification.Name.UIKeyboardWillChangeFrame, object: nil) | |
} | |
@objc func keyboardWillChange(_ notification: NSNotification) { | |
let duration = notification.userInfo![UIKeyboardAnimationDurationUserInfoKey] as! Double |
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 EventEmitter | |
/// Shared Instance. | |
public static var sharedInstance = EventEmitter() | |
// ReactNativeEventEmitter is instantiated by React Native with the bridge. | |
private static var eventEmitter: ReactNativeEventEmitter! | |
private init() {} |
NewerOlder