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
/* | |
subscriber will be assigned to default role when they sign up | |
*/ | |
function my_pmpro_after_change_membership_level($level_id, $user_id) | |
{ | |
if($level_id > 0){ | |
$role = get_option('pmpro_role_for_id_'.$level_id); | |
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
<select name="" id="" > | |
<option value="995|QZ" title="Abkhazia +995">Abkhazia +995</option> | |
<option value="93|AF" title="Afghanistan +93">Afghanistan +93</option> | |
<option value="358|AX" title="Aland Islands +358">Aland Islands +358</option> | |
<option value="355|AL" title="Albania +355">Albania +355</option> |
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
-- MySQL dump 10.13 Distrib 5.6.35, for osx10.9 (x86_64) | |
-- | |
-- Host: localhost Database: student_test | |
-- ------------------------------------------------------ | |
-- Server version 5.6.35 | |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |
/*!40101 SET NAMES utf8 */; |
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
$ cd ~ | |
$ sudo curl -sS https://getcomposer.org/installer | sudo php | |
$ sudo mv composer.phar /usr/local/bin/composer | |
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer | |
then you can run | |
$ sudo composer install |
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
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
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://stackoverflow.com/questions/55320737/how-to-wait-for-a-promise-to-resolve-or-reject-then-move-to-next-command#55320737 | |
// your original code | |
const validatePreconditions = ({ exitOnFailure = true } = {}) => { | |
let portSuccess = true | |
checkIfPortIsAvailable(3000).then((val) => portSuccess = val , (err) => console.log("DEBUG1:",err)) | |
console.log("DEBUG2:",portSuccess) | |
if (! portSuccess && exitOnFailure) { | |
logger.error(colors.red('Exiting due to unsatisfied precondition!')) |
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 hash = {}; |
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 hash = {}; | |
// to get the value for a particular index | |
const get = index => typeof hash[index] !== "undefined" ? hash[index] : null; | |
// add a new value in a particular index | |
const set = (index, data) => { | |
if( typeof hash[index] === "undefined"){ | |
hash[index] = []; | |
} |
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 fs = require('fs'); | |
const path = require('path'); | |
const dbFilePath = path.join(__dirname, 'db.json'); // path to the json file where we are storing our hash data | |
const MAX_TRY_COUNT = 5; // Maximum numebr of attempts in case of failure | |
let readTryCount = 0; // hold the read try count | |
let writeTryCount = 0; // hold the write try count | |
const hash = {}; |
OlderNewer