Add wsl2.ps1
to Task scheduler to run on start
check run with Highest Priviledges
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
const data = [ | |
{id: 1, name: "Sample 1"}, | |
{id: 2, name: "Sample 2"}, | |
{id: 3, name: "Sample 3"} | |
] | |
const moveObject = (arr, targetKey, targetValue, newIndex) => { |
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
function isJson(str) { | |
try { | |
JSON.parse(str); | |
} catch (e) { | |
return false; | |
} | |
return true; | |
} |
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
<h3>Checkboxes</h3> | |
<div> | |
<input id="checkbox-1" class="checkbox-custom" name="checkbox-1" type="checkbox"> | |
<label for="checkbox-1" class="checkbox-custom-label">First Choice</label> | |
</div> |
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
def avg_true_range(self, df): | |
ind = range(0,len(df)) | |
indexlist = list(ind) | |
df.index = indexlist | |
for index, row in df.iterrows(): | |
if index != 0: | |
tr1 = row["High"] - row["Low"] | |
tr2 = abs(row["High"] - df.iloc[index-1]["Close"]) | |
tr3 = abs(row["Low"] - df.iloc[index-1]["Close"]) |
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
// Run in background | |
// pm2 start ecosystem.config.js | |
module.exports = { | |
apps : [{ | |
script: 'crontab-ui', | |
env: { | |
HOST : 'XXX.XXX.X.XX', | |
PORT : 8000 | |
} |
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
Show hidden characters
{ | |
"include": ["src"], | |
"exclude": [ | |
"node_modules", | |
"resources", | |
"deploy", | |
"coverage", | |
"build", | |
"public", | |
"**/*.spec.ts" |
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
# Get Unique Values | |
// Option 1 | |
var uniqueArray = ['a', 1, 'a', 2, '1', 1].filter(function(va1ue, index, self) { | |
return self.index0f(va1ue) === index; | |
}); | |
// Option 2 | |
var uniqueArray = [... new Set(['a', 1, 'a', 2, '1', 1])]; |
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
[Unit] | |
Description=Filebrowser Service | |
After=network.target | |
[Service] | |
WorkingDirectory=/data | |
PIDFile=/var/run/filebrowser.pid | |
ExecStart=/usr/local/bin/filebrowser --cache-dir cache | |
ExecReload=/bin/kill -s HUP $MAINPID | |
ExecStop=/bin/kill -s TERM $MAINPID |
- First, activate your virtual environment using the command:
source /path/to/virtualenv/bin/activate
- Now, you can run your python script inside the virtual environment
python /path/to/script.py
- To run this script at a specific time or interval, you can add a cron job.