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 isEmail = (email) => { | |
const regex = /(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/; | |
return regex.test(email); | |
} | |
const validEmails = [ | |
'[email protected]', | |
'[email protected]', | |
'[email protected]', | |
'[email protected]', |
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
// You can use this file to test the server-sdk | |
const { Vonage } = require('@vonage/server-sdk') | |
const { tokenGenerate } = require('@vonage/jwt'); | |
const { readFileSync } = require('fs'); | |
const VONAGE_API_KEY = process.env.VONAGE_API_KEY | |
const VONAGE_API_SECRET = process.env.VONAGE_API_SECRET | |
const appId = '<application id>'; | |
const privateKey = readFileSync(`${__dirname}/private.key`); |
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
https://www.amazon.com/gp/product/B07QR6Z1JB/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8&psc=1 | |
https://www.amazon.com/gp/product/B07DHLSTLV/ref=ppx_yo_dt_b_asin_title_o06_s01?ie=UTF8&psc=1 | |
https://www.amazon.com/gp/product/B01LZIDS2A/ref=ppx_yo_dt_b_asin_title_o07_s00?ie=UTF8&psc=1 | |
https://www.amazon.com/gp/product/B00I3SVVWC/ref=ppx_yo_dt_b_asin_title_o07_s00?ie=UTF8&psc=1 | |
https://www.amazon.com/gp/product/B01JNLUA5G/ref=ppx_yo_dt_b_asin_title_o07_s00?ie=UTF8&psc=1 | |
https://www.amazon.com/gp/product/B0006H92QK/ref=ppx_yo_dt_b_asin_title_o07_s01?ie=UTF8&psc=1 |
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
/** | |
* @fileOverview Generate an Id | |
*/ | |
const _ = require('lodash'); | |
const Hashids = require('hashids'); | |
const hashids = new Hashids( | |
'', | |
null, | |
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-', | |
); |
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
/** | |
* @fileOverview Generate an Id | |
*/ | |
const _ = require('lodash'); | |
const {Hashids} = require('hashids'); | |
const hashids = new Hashids( | |
'', | |
null, | |
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-', | |
); |
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 fetchUsersFromCognito = async ( | |
cognitoService, | |
userPoolId, | |
limit = 60, | |
pageToken = null, | |
) => { | |
// Not documented in AWS docs but the max limit for this service is 60 | |
if (limit > 60 || limit < 1) { | |
throw new Error('Invalid range for limit'); | |
} |
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
# Kernel sysctl configuration file for Red Hat Linux | |
# | |
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and | |
# sysctl.conf(5) for more details. | |
################################ | |
### Kernal / Memory settings ### | |
################################ | |
# Controls the System Request debugging functionality of the kernel |
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
phpunit | |
PHPUnit 4.8.27 by Sebastian Bergmann and contributors. | |
..................................EEEEEE......................EE. 65 / 77 ( 84%) | |
EE...EEEE..E | |
Time: 768 ms, Memory: 6.00MB | |
There were 15 errors: |
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 | |
# @source: https://gist.github.com/ronanguilloux/11f6a788358577474ab4 | |
# @link http://tech.zumba.com/2014/04/14/control-code-quality/ | |
target_docker_name="api" | |
bash $PWD/bin/setup-docker.sh $target_docker_name | |
if [ $? != 0 ] | |
then | |
>&2 echo "[pre-commit] no $target_docker_name docker-machine running" |
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
<?php | |
class Foo { | |
private $bar = 'chuck'; | |
public function __construct($name = 'max') | |
{ | |
$this->bar = $name; | |
} |
NewerOlder