-
Find the Discord channel in which you would like to send commits and other updates
-
In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe!
Discover gists
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 androidx.compose.animation.core.* | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.layout.* | |
import androidx.compose.foundation.shape.CircleShape | |
import androidx.compose.material.MaterialTheme | |
import androidx.compose.material.Text | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.getValue | |
import androidx.compose.ui.Alignment | |
import androidx.compose.ui.Modifier |
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 pandas as pd | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
def print_confusion_matrix(confusion_matrix, class_names, figsize = (10,7), fontsize=14): | |
"""Prints a confusion matrix, as returned by sklearn.metrics.confusion_matrix, as a heatmap. | |
Note that due to returning the created figure object, when this funciton is called in a | |
notebook the figure willl be printed twice. To prevent this, either append ; to your | |
function call, or modify the function by commenting out the return expression. |
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
<div x-data="googlePlacesAutocomplete" class="grid grid-cols-3 gap-2"> | |
<input type="text" x-model="address.address1" x-ref="googleAutocomplete" autocomplete="chrome-off" class="col-span-3 sm:col-span-2 order-1" placeholder="Add‌ress"> | |
<input type="text" x-model="address.address2" placeholder="Apt/Ste" class="col-span-3 sm:col-span-1 order-2"> | |
<input type="text" x-model="address.city" placeholder="Ci‌ty" class="col-span-1" x-bind:class="`order-${order.locality}`"> | |
<select x-model="address.state" placeholder="State" class="col-span-1 order-4" x-show="isUSA"> | |
<option value="">State</option> | |
<option value="AL">Alabama</option> | |
<option value="AK">Alaska</option> | |
<option value="AZ">Arizona</option> | |
<option value="AR">Arkansas</option> |
Coredump contains stack information as well. If you can use this stack information along with the EBP and EIP register values in the coredump file, you can print the stack trace. I had written a program to do this. You can find the program in the following link.
https://gist.github.com/root42/c979b037f85dc4b2be1f3735afedeb1d
Usage: Compile the above program and give the corefile when you execute it.
$corestrace core
If you want symbols also to be printed, you do like this: Let's assume the program that generated the core is 'test'.
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
// ==UserScript== | |
// @name Weibo Huati Check-in | |
// @description 超级话题集中签到 | |
// @namespace https://greasyfork.org/users/10290 | |
// @version 0.4.2018053114 | |
// @author xyau | |
// @match http*://*.weibo.com/* | |
// @match http*://weibo.com/* | |
// @icon https://n.sinaimg.cn/photo/5b5e52aa/20160628/supertopic_top_area_big_icon_default.png | |
// @grant GM_getValue |
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
from typing import Optional, Tuple | |
import torch | |
from torch.utils.data import Dataset, random_split | |
def train_test_split( | |
dataset: Dataset, | |
test_ratio: float, | |
seed: Optional[int] = None, |
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
rm -rf /etc/systemd/system/ceph* | |
killall -9 ceph-mon ceph-mgr ceph-mds | |
rm -rf /var/lib/ceph/mon/ /var/lib/ceph/mgr/ /var/lib/ceph/mds/ | |
pveceph purge | |
apt -y purge ceph-mon ceph-osd ceph-mgr ceph-mds | |
rm /etc/init.d/ceph | |
for i in $(apt search ceph | grep installed | awk -F/ '{print $1}'); do apt reinstall $i; done | |
dpkg-reconfigure ceph-base | |
dpkg-reconfigure ceph-mds | |
dpkg-reconfigure ceph-common |
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
from collections import OrderedDict | |
import numpy as np | |
import matplotlib | |
matplotlib.use('TkAgg') | |
import warnings; | |
with warnings.catch_warnings(): | |
warnings.simplefilter("ignore"); | |
import matplotlib.pyplot as plt | |
from skimage.transform import rescale |
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 mmap | |
import torch | |
import json | |
import os | |
from huggingface_hub import hf_hub_download | |
def load_file(filename, device): | |
with open(filename, mode="r", encoding="utf8") as file_obj: | |
with mmap.mmap(file_obj.fileno(), length=0, access=mmap.ACCESS_READ) as m: |
NewerOlder