Skip to content

Instantly share code, notes, and snippets.

@br3ndonland
br3ndonland / github-actions-notes.md
Last active May 5, 2024 07:39
Getting the Gist of GitHub Actions
@kalomaze
kalomaze / modeling_mixtral.py
Created May 5, 2024 03:38
Fixed Mixtral training code for HF Transformers
# coding=utf-8
# Copyright 2023 Mixtral AI and the HuggingFace Inc. team. All rights reserved.
#
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
# and OPT implementations in this library. It has been modified from its
# original forms to accommodate minor architectural differences compared
# to GPT-NeoX and OPT used by the Meta AI team that trained the model.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@echo off
NET SESSION >nul 2>&1
IF %ERRORLEVEL% NEQ 0 GOTO ELEVATE >nul
GOTO ADMINTASKS
:ELEVATE
CD /d %~dp0 >nul
MSHTA "javascript: var shell = new ActiveXObject('shell.application'); shell.ShellExecute('%~nx0', '', '', 'runas', 1);close();" >nul
EXIT
@Geczy
Geczy / migrate.sh
Last active May 5, 2024 07:32
Migrate Coolify to a new server
#!/bin/bash
# This script will backup your Coolify instance and move everything to a new server. Docker volumes, Coolify database, and ssh keys
# 1. Script must run on the source server
# 2. Have all the containers running that you want to migrate
# Configuration - Modify as needed
sshKeyPath="$HOME/.ssh/your_private_key" # Key to destination server
destinationHost="server.example.com"
@Saw-mon-and-Natalie
Saw-mon-and-Natalie / loadExternalJs.md
Created September 27, 2019 06:38
javascript code snippet to use to load external JS libraries inside chrome dev tools console

How to import external JS libraries in Chrome dev tools console

fetch('link-to-external-js-library')
    .then(response => response.text())
    .then(text => eval(text))

example, loading lodash:

@Verssae
Verssae / skip.js
Last active May 5, 2024 07:30
한양대학교 인권/폭력예방 교육시스템 스킵 스크립트
/**
[강의 영상 스킵]
1. 재생버튼을 눌러 한양대 로딩 영상이 끝나고(약 4초) 강의가 재생된 후 F12 버튼을 눌러 개발자 콘솔을 연 뒤 console 탭으로 이동한다.
2. 아래 스크립트를 붙여넣는다.
3. 사이트에서 나갈 것이냐고 묻는 창이 뜨면 '나가기'를 누른다.
4. 다시 영상이 로드되면 재생 버튼을 눌러 재생하고 영상 끝으로 컨트롤 버튼을 움직여 영상 시청을 완료한다.
**/
@tas9n
tas9n / SimpleTextBox.hpp
Last active May 5, 2024 07:28
デバッグ用テキストボックス
#pragma once
#include <Siv3D.hpp>
/// @brief Simple text box
/// @tparam T Text box value
template<typename T>
struct SimpleTextBox {
mutable TextEditState edit;
String label;
T init;
@tanaikech
tanaikech / submit.md
Last active May 5, 2024 07:26
Uploading Local Files to Google Drive without Authorization using HTML Form

Uploading Local Files to Google Drive without Authorization using HTML Form

This is a sample script for uploading local file to Google Drive without the authorization using HTML form. A selected file in your local PC using HTML form is uploaded to Google Drive and saved to Google Drive.

When you use this, at first, please deploy Web Apps. The script is doPost() of following scripts.

Script : Google Apps Script

function doPost(e) {
 var data = Utilities.base64Decode(e.parameters.data);
@MatinMN
MatinMN / CommentResource.php
Created September 28, 2023 01:36
Polymorphic relationship in Filament example 1-1 , 1-m
<?php
namespace App\Filament\Resources;
use App\Filament\Resources\CommentResource\Pages;
use App\Filament\Resources\CommentResource\RelationManagers;
use App\Filament\Resources\PostResource\RelationManagers\CommentsRelationManager;
use App\Models\Comment;
use App\Models\Post;
use App\Models\User;
@kmobs
kmobs / DampingRatio.md
Last active May 5, 2024 07:22
Calculating the damping ratio for your hardware:

Prerequisite - Outdated. I don't use the resonance testing branch or pulses method anymore.

I recommend running Dmitry’s latest resonance testing branch and using the pulses method outlined below:

https://github.com/Klipper3d/klipper/issues/4560
https://github.com/dmbutyugin/klipper/tree/resonance-test-methods

I would only go down this path if you're getting ghosting with really high speed prints. On the Annex Engineering K3 for example, no matter how perfect the graphs looked, I was still getting some ghosting. That prompted me to go down this path. I'm now able to print at 20-30k acceleration, 250-350mm/s, and 15scv with perfect quality that can usually only be seen at significantly slower speeds.

The default settings in Klipper have the damping ratio set to .1. This should be fine for most people with sane settings. I like to go for the insane.