Skip to content

Instantly share code, notes, and snippets.

View chyld's full-sized avatar
:electron:
import numpy

Chyld Medford chyld

:electron:
import numpy
View GitHub Profile
dotnet new tool-manifest
dotnet tool install dotnet-ef
dotnet ef
dotnet add App/App.csproj package Microsoft.EntityFrameworkCore.Design
dotnet add App/App.csproj package Microsoft.EntityFrameworkCore.Tools
dotnet add App/App.csproj package Microsoft.EntityFrameworkCore.SQLite
dotnet ef migrations add "initial"
const path = require("path");
module.exports = {
mode: "development",
entry: "./src/main.ts",
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
inverse
$$\begin{pmatrix}
1.88 & 0.67 & -0.16 \newline
0.91 & 1.9 & -0.59 \newline
1.79 & 1.83 & 0.52
\end{pmatrix}$$
$$\begin{pmatrix}
0.6584 & -0.2042 & -0.0291 \newline
# for f in 'engagement_managers', 'clients', 'instructors', 'units':
# self.fields[f].required = False
# self.fields['products'] = forms.CharField(widget=ProductWidget)
# self.fields['products'].queryset = 'llolololo'
24292F - nav black
454D56 - nav black inside border
-----------------------------------------------
FFFFFF - nav text
FAFBFC - light gray background color
E2E4E8 - border color with gray background
E0E4E7 - border color with white background
EAECEF - horizontal line
-----------------------------------------------
F1F8FF - light blue background
@chyld
chyld / debug.html
Created January 10, 2021 05:06
django template debug helper
<textarea style="width: 900px; height: 300px; font-family: monospace; border: 2px solid #ff33cc; padding: 10px;">
{% filter force_escape %} {% debug %} {% endfilter %}
</textarea>
<pre> {% filter force_escape %} {% debug %} {% endfilter %} </pre>
def plot_uniform(start, order_of_magnitude, rows, cols, *colors):
fig = plt.figure(figsize=(12, 7))
for i in range(1, order_of_magnitude + 1):
samples = start ** i
vals, counts = np.unique(randint(low=1, high=7).rvs(samples), return_counts=True)
ax = fig.add_subplot(rows, cols, i)
ax.bar(vals, counts, color=colors[i-1], alpha=0.7)
ax.set_title("{} samples".format(samples))
plt.suptitle('Dice Rolls', fontsize=50)
fig.tight_layout()
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.express as px
import pandas as pd
# ----------------------------------------------------------------------------------------------- #
# ----------------------------------------------------------------------------------------------- #
# ----------------------------------------------------------------------------------------------- #
git restore filename
git restore -p filename (patch level)
git restore .
git commit --amend -m "change last commit"
git revert <commit hash> # creates a new commit at head that undoes a previous commit
get reset --hard --soft --mixed <hash>
git reflog # look at the history of the head pointer
git branch <name> <hash> # starts the branch at a particular hash