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 { useState, useRef } from "react"; | |
const Timer = ( initial: number, ascending: boolean) => { | |
const [ms, setMs] = useState(initial * 100) | |
const [timesUp, setTimesUp] = useState<boolean>(false) | |
const intervalRef = useRef<number>() | |
function convertMSTimeToString (ms: number){ | |
const minutes = String(Math.floor( ms / 100 / 60)).padStart(2, '0') |
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
#!/bin/bash | |
# PLACEHOLDERS | |
# [STAGING_FOLDER] - staging directory in your server | |
# [STAGING_URL] - staging url | |
# [STAGING_USER] - staging user in the server | |
# [STAGING_MYSQLUSER] - staging mysql user | |
# [STAGING_MYSQLPASSWORD] - staging mysql password | |
# [ROOTUSER] - Mysql root user | |
# [ROOTPASSWORD] - Mysql root password |
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
# ----------------------------------------------------------------- | |
# .gitignore for WordPress | |
# Bare Minimum Git | |
# http://ironco.de/bare-minimum-git/ | |
# ver 20150227 | |
# | |
# This file is tailored for a WordPress project | |
# using the default directory structure | |
# |
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
({ | |
_render: function() { | |
// load default options using app strings | |
this._setSelectField("element_id_here", "", app.lang.getAppListStrings("cstm_lead_source_list") , false, null, null, null); | |
// if you want to load default selected value | |
$('#element_id_here').select2('val','id_in_the_option_list'); | |
// load options from records of a module | |
this._setSelectField("element_id_of_the_field", "", null, "Accounts", "name", this.getPersonRecordList); | |
}, | |
getPersonRecordList: function(strName, strModule, fieldname, callback) { |
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
'use strict'; | |
const _ = require('lodash'); | |
const parseReason = function (message) { | |
const regexBecause = /because \[(.*?)(\]|$)/; | |
let parsedMessage = message; | |
if (regexBecause.test(message)) { | |
parsedMessage = regexBecause.exec(message)[1]; |