-
Zero-downtime: Multiple releases of the code that understand different database schemas can simultaneously write to the database.
-
Triggers: Triggers are used to keep old and new schemas in sync while the application undergoes a rolling upgrade.
-
Expand-migrate-contract: The migration is performed in three phases. The expand phase creates new columns (and possibly tables), and triggers. The migrate phase moves data from the old column to the new column. The contract phase removes old columns (and possible tables), and triggers.
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
<?php | |
namespace App\Providers; | |
use Illuminate\Support\Collection; | |
use Illuminate\Pagination\LengthAwarePaginator; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
public function boot() |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the\
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
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 transformers import ElectraForMaskedLM, ElectraForPreTraining | |
from transformers.models.electra.modeling_electra import ElectraForPreTrainingOutput | |
from torch import Tensor | |
import torch.nn.functional as F | |
import torch.nn as nn | |
import torch | |
class ElectraModel(nn.Module): | |
def __init__(self, |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
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
// same as your regular shadcn datatable implementation (which uses tanstack table) | |
// note that the shadcn datatable uses shadcn table for the ui. see https://ui.shadcn.com/docs/components/data-table | |
import { | |
ColumnFiltersState, | |
SortingState, | |
VisibilityState, | |
flexRender, | |
getCoreRowModel, | |
getFilteredRowModel, |
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
// same as your regular shadcn datatable implementation (which uses tanstack table) | |
// note that the shadcn datatable uses shadcn table for the ui. see https://ui.shadcn.com/docs/components/data-table | |
import { | |
ColumnFiltersState, | |
SortingState, | |
VisibilityState, | |
flexRender, | |
getCoreRowModel, | |
getFilteredRowModel, |
http://stackoverflow.com/questions/24380159/corebluetooth-and-wifi-interference
http://lists.apple.com/archives/bluetooth-dev/2013/Aug/msg00023.html
This is a well known issue, and it has a solution that is confirmed to work for the Mac side.
sudo defaults write /Library/Preferences/com.apple.airport.bt.plist bluetoothCoexMgmt Hybrid
After you run this script, the issue will go away and BT connections will remain stable.
I've used this in the past to grab offline copies of some of the Google API docs.
$ wget --no-parent --recursive --page-requisites --html-extension --convert-links "http://code.google.com/apis/gears/"
# --no-parent - Don't fetch anything in the parent directory of the URL specified
# --page-requisites - Download everything required for the page to display correctly
# --recursive - Recursively download (use default depth of 5)
# --html-extension - Add .html to downloaded html files (this isn't necessarily required for the google code example but might be useful on other sites)
NewerOlder