To have a percentage of viewing window use vh
{
overflow: scroll;
max-height: 90vh;
}
Overflow scrolls means extra space will be scrolled
To have a percentage of viewing window use vh
{
overflow: scroll;
max-height: 90vh;
}
Overflow scrolls means extra space will be scrolled
var t = 'some sting characters ktestvarj';
var variables = {
'testvar': 123,
'testvar1': 456
};
function replacer(match, p1, offset, string) {
return variables[p1];
}
var modify = function (str) {
var teststr = str.replace(/k(.*?)j/g, replacer);
console.log(teststr);
}
modify(t);
modify('some ktestvarj sting characters ktestvarj ktestvar1j');
AsyncBatch = function(context) {
var items = [],
asycnCount = 0,
onComplete,
ctx = context || window;
this.add = function(fn, params) {
items.push({
fn: fn,
params: params
});
}
this.run = function(callback) {
onComplete = callback;
for (var i in items) {
items[i].fn.apply(this, items[i].params);
}
}
this.done = function() {
…
var myPromise = new Promise((resolve, reject) => {
SPA.checkEverwashDirectSingle(serviceLocation.id, async function (res1) {
console.log(res1);
resolve(res1)
})
});
myPromise.then((value) => {
pre.loadTemplate(‘page/locations/new.php’, function (template) {
$(‘#content-container’).html(template({
location: {},
owners: owners,
salespeople: salespeople,
isEverWashDirect: value
}));
});
});
export type Fruit = "Orange" | "Apple" | "Banana";
let myString: string = "Banana";
let myFruit: Fruit = myString as Fruit;
Also notice that when using string literals you need to use only one |
As mentioned in the other answer by @Simon_Weaver, it's now possible to assert it to…
React components keep resetting creating a problem. The best way to solve is to move the prop up and then use context to avoid prop drilling
https://stackoverflow.com/questions/45400361/why-is-gitignore-not-ignoring-my-files
.gitignore
only ignores files that are not part of the repository yet. If you already git add
ed some files, their changes will still be tracked. To remove those files from your repository (but not from your file system) use git rm --cached
on them.
I used this to clear out a file, and then essentially they got removed but then readded during a the next commit. I chose the entire file
git rm — cached -r client
the -r was required to do so recursively (ie, remove files already on commit branch”
while using .src can be an option, it isn’t really a functional one for grabbing something from the component. I use relative paths for the initial link but the output on firefox is the absolute path making matching difficult
Also, keyof typeof is the best way to make sure something…