Skip to content

Instantly share code, notes, and snippets.

@ashmalvayani
ashmalvayani / solve.py
Created April 18, 2024 17:27
"triu_tril_cuda_template" not implemented for 'BFloat16'
## One of the two worked for me, not sure so writing it both:
pip uninstall flash-attn
FLASH_ATTENTION_FORCE_BUILD=TRUE pip install flash-attn
## Upgrading the torch version to 2.1.0 with this command:
conda install pytorch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 pytorch-cuda=11.8 -c pytorch -c nvidia
@scriptdev
scriptdev / .php
Last active April 19, 2024 13:52
CLASSE PARA PREENCHER A COMBO "TCombo" ANO e MÊS
<?php
class Funcoes
{
public static function meses()
{
return [
'01' => 'JANEIRO',
'02' => 'FEVEREIRO',
'03' => 'MARÇO',
@pdemarti
pdemarti / s3-fast-upload.ipynb
Last active April 19, 2024 13:50
Example (from a notebook) on how to exploit the concurrency inside boto3 for fast uploads of many files
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@scriptdev
scriptdev / .php
Created June 22, 2022 16:40
DEFINIR LARGURA RESPONSIVA "DESKTOP, TABLET e CELULAR" NA JANELA MODAL "TWindow"
<?php
public function __construct( $param )
{
if (parent::isMobile()) { parent::setSize(0.8, null); } else { parent::setSize(800, null); }
# ( parent::setSize(0.8, null); ) DEFININDO A LARGURA 100% "0.8" QUANDO FOR MOBILE (TABLET ou CELULAR)
# ( parent::setSize(800, null); ) DEFININDO A LARGURA 800px QUANDO FOR DESKTOP
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 19, 2024 13:50
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@scriptdev
scriptdev / .php
Created June 22, 2022 23:47
APLICAR UM TEMPO EM UM PROCESSO
<?php
public function onSearch($param = null)
{
$data = $this->form->getData();
$filters = [];
sleep(3); # APLCA UM TEMPO DE 3 SEGUNDOS, EM SEGUIDA EXECUTA O CÓDIGO ABAIXO.
TSession::setValue(__CLASS__.'_filter_data', NULL);
@souhaiebtar
souhaiebtar / dbeaver.ini
Last active April 19, 2024 13:48
[dbeaver config file] .ini file for dbeaver #dbeaver #linux
# path on linux /usr/share/dbeaver/dbeaver.ini
# path on macos /Applications/DBeaverEE.app/Contents/Eclipse/dbeaver.ini
-vm
/usr/bin/java
-startup
plugins/org.eclipse.equinox.launcher_1.5.600.v20191014-2022.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.1100.v20190907-0426
-vmargs
-XX:+IgnoreUnrecognizedVMOptions
@scriptdev
scriptdev / .php
Last active April 19, 2024 13:48
DESABILITAR CAMPO VIA jQUERY e JAVASCRIPT
<?php
$btn_exemplo->id = 'ID_CAMPO';
# jQUERY - DESABILITA TODOS OS CAMPOS DO FORMULÁRIO (TEXTO, COMBO, RADIO, CHECKBOX)
TScript::create("$('form input[type=text], form input[type=date], form input[type=radio], form input[type=checkbox], form textarea, form select').prop('disabled', true);");
# jQUERY - HABILITA TODOS OS CAMPOS DO FORMULÁRIO (TEXTO, COMBO, RADIO, CHECKBOX)
TScript::create("$('form input[type=text], form input[type=date], form input[type=radio], form input[type=checkbox], form textarea, form select').prop('disabled', false);");
@scriptdev
scriptdev / .php
Created June 25, 2022 03:12
PROCURAR USUÁRIO SystemUsers PELO E-MAIL ou LOGIN
<?php
TTransaction::open('permission');
# PROCURAR PELO E-MAIL DO USUÁRIO
$email = 'fabricio.dev.pb@gmail.com';
SystemUsers::where('email', '=', $email)->first();
# PROCURAR PELO E-MAIL DO USUÁRIO
@dcts
dcts / workbench.colorCustomizations.json
Created April 14, 2020 16:51 — forked from jacklorusso/workbench.colorCustomizations.json
A list of all Visual Studio Code customizable colors, grouped by UI region. Copy and paste into User Settings (comments are allowed) to tweak an existing theme or work on your own.
"workbench.colorCustomizations": {
// Contrast Colors - The contrast colors are typically only set for high contrast themes. If set, they add an additional border around items across the UI to increase the contrast.
"contrastActiveBorder": "",
"contrastBorder": "",
// Base Colors
"focusBorder": "",
"foreground": "",
"widget.shadow": "",
"selection.background": "",
"descriptionForeground": "",