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
import { | |
JupyterFrontEnd, | |
JupyterFrontEndPlugin | |
} from '@jupyterlab/application'; | |
import { NotebookActions } from '@jupyterlab/notebook'; | |
/** | |
* Initialization data for the constellate_lab_usage extension. | |
*/ | |
const plugin: JupyterFrontEndPlugin<void> = { |
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
new() { | |
# Create a new project | |
# Usage: new project-name | |
# Options: | |
# --python: Initialize a new Python project | |
# --node: Initialize a new Node project | |
# --nuxt: Initialize a new Nuxt project | |
# --csharp: Initialize a new C# dotnet core MVC project | |
# --override: Override existing project | |
usage() { |
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/bash | |
# Build and scan with trivy | |
IMAGE_TAG=$1 | |
DOCKERFILE="${2:-Dockerfile}" | |
docker build -t $IMAGE_TAG . -f $DOCKERFILE \ | |
&& trivy image --severity HIGH,CRITICAL $IMAGE_TAG --report summary --scanners vuln |
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
# alias for setting upstream on origin for current branch | |
[alias] | |
push-new = ! git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD) |
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/bash | |
N=10 | |
for i in $(seq 1 $N); do echo ./makemeparallel.py $i &; done | |
echo 'VOILA!' |
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
# replace md5sum with md5 on a mac | |
# for javascript/node codebase | |
find -s client -not -path "*/node_modules/*" -type f -exec md5sum {} \; | md5sum | |
# python codebase with venv/ | |
find -s backend -not -path "*/venv/*" -type f -exec md5sum {} \; | md5sum |
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 allClasses = [ | |
{ | |
id: 1, | |
name: 'Yoga 100', | |
enrolled: 10, | |
maxCapacity: 11, | |
}, | |
{ | |
id: 2, | |
name: 'Yoga 200', |
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 enumValue = (name) => Object.freeze({toString: () => name}); | |
const Colors = Object.freeze({ | |
RED: enumValue("Colors.RED"), | |
BLUE: enumValue("Colors.BLUE"), | |
GREEN: enumValue("Colors.GREEN") | |
}); |
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
def lcm(nums): | |
greatest = max(nums) | |
while True: | |
all_good = all( | |
list(map(lambda x: greatest % x == 0, nums)) | |
) | |
if all_good: | |
return greatest | |
greatest += 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
const taxPayer = { | |
firstName: 'Ian', lastName: 'DesJardins', | |
ssn: '123-45-6789', pastDue: true, | |
}; | |
console.log('Object destructuring example'); | |
// destructure the taxPayer object into new variables | |
const { firstName, lastName, ssn, pastDue } = taxPayer; | |
console.log('firstName =', firstName); |
NewerOlder