The git pre-commit hook and the VS Code settings I use when developing Svelte apps.
// A pattern I often find myself using consists of a report-type page that | |
// displays any amount of data. At the top of that page is a `<form>` containing | |
// one or more `<select>` elements whose purpose is to filter the data on the | |
// report. | |
// The form uses `method="GET"`, which is great to make sure that the URL stays | |
// in line with what the page shows. A user can bookmark/favorite the URL and | |
// come back to it later. A user can share the URL so other users can see | |
// exactly the same page. |
import { useState } from 'react' | |
import { useRouter } from 'next/router'; | |
import { Listbox } from '@headlessui/react' | |
import { ChevronUpDownIcon } from '@heroicons/react/20/solid' | |
import queryString from "query-string"; | |
export interface FilterOption { | |
value: string; | |
label: string; | |
} |
git clone myusername@myserver:/home/git/myrepo | |
# `myusername` is your username on the server which hosts a bare git repository | |
# `myserver` is a `Host` configured in `~/.ssh/config` on your local machine | |
# `/home/git/myrepo` is the path to the bare repository on the server |
cargo watch -c -w src -x run | |
# -c : Clear the terminal before each reload | |
# -w : Which files to watch | |
# -x : What command to execute | |
# cargo-watch must be installed. | |
cargo install cargo-watch |
function getFilledArray<T>(value: T, n: number): T[] { | |
return Array(n).fill(value); | |
} | |
let stringArray: string[]; | |
let numberArray: number[]; | |
let personArray: {name: string, age: number}[]; | |
let coordinateArray: [number, number][]; | |
// Write your code below: |
Use this package.json
for initializing new npm packages. It will make the
package a pure ESM package. Feel free to fork this and replace the author and/or
license information.
Install the VS Code extensions:
- Open VS Code
- Ctrl + Shift + X
- Search for "ESLint"
- Click the blue "Install" button
- Search for "Prettier"
- Click the blue "Install" button
In your project directory (the one containing package.json
), install the development dependencies:
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/css/bootstrap.min.css"> | |
<style> | |
.completed { text-decoration: line-through; } |
Please see Patrick330's fork of this script.
ClassDojo changes their site regularly, so a script like this needs regular maintenance. I have decided to archive this project and stop providing updates. Patrick330's fork linked above may be a good alternative.
ClassDojo is a classroom communication app used to share reports between parents and teachers. Teachers track student behavior and upload photos or videos. The gamification style system teaches developmental skills through real-time feedback.