This workflow uses the GitHub CLI to keep a forked repo in sync with the upstream repo. Add it to your repo as .github/workflows/sync-fork.yaml
.
It runs daily to sync the default branch and can be triggered manually for any branch.
// Credits to Louistiti from Drizzle Discord: https://discord.com/channels/1043890932593987624/1130802621750448160/1143083373535973406 | |
import { sql } from "drizzle-orm"; | |
const clearDb = async (): Promise<void> => { | |
const query = sql<string>`SELECT table_name | |
FROM information_schema.tables | |
WHERE table_schema = 'public' | |
AND table_type = 'BASE TABLE'; | |
`; |
/* -------------------------------------------------------------------------- */ | |
/* More here; */ | |
/* -------------------------------------------------------------------------- */ | |
//gist.github.com/rphlmr/0d1722a794ed5a16da0fdf6652902b15 | |
https: export function distinctOn<Column extends AnyColumn>(column: Column) { | |
return sql<Column["_"]["data"]>`distinct on (${column}) ${column}`; | |
} | |
export function jsonBuildObject<T extends SelectedFields>(shape: T) { |
I felt the importance of directly editing a file from a DigitalOcean droplet on my Ubuntu Server. I research on the internet and made a way to do it.
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php | |
/** | |
* Manage WooCommerce styles and scripts. | |
*/ | |
function grd_woocommerce_script_cleaner() { | |
// Remove the generator tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
<?php | |
// PHP memory limit for this site | |
define( 'WP_MEMORY_LIMIT', '128M' ); | |
define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit. | |
// Database | |
define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database. | |
define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users) | |
// Explicitely setting url |
We have Server machine, this computer with Headphones, and we have Client computer, this is remote PC with music =) On Server we should first open port for listening connections from Client :
# on ubuntu
sudo ufw allow from <Client_IP> to any port 4656 proto tcp
# on fedora ( with firewalld )
sudo firewall-ctl --add-port 4656/tcp
note: port 4656 just for sample. you can use any port you want
than on Server, from current user add listening for connections
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import org.bukkit.Location; | |
import org.bukkit.entity.ArmorStand; | |
import org.bukkit.entity.EntityType; | |
import org.bukkit.inventory.ItemStack; | |
import org.bukkit.plugin.java.JavaPlugin; | |
import org.bukkit.scheduler.BukkitRunnable; |
rebase
vs merge
).rebase
vs merge
)reset
vs checkout
vs revert
)git rev-parse
)pull
vs fetch
)stash
vs branch
)reset
vs checkout
vs revert
)import torch | |
from datasets import load_dataset | |
from peft import LoraConfig, get_peft_model | |
from transformers import AutoTokenizer, AutoModelForCausalLM | |
from trl import DPOTrainer | |
if __name__ == "__main__": | |
model_name = "..." | |
dataset = load_dataset(...) |