Skip to content

Instantly share code, notes, and snippets.

@sousagarcia
sousagarcia / .php
Created June 29, 2021 12:01 — forked from scriptdev/.php
ATUALIZAÇÃO AUTOMÁTICA DOS REGISTROS DO DATAGRID APÓS x TEMPO
<?php
public function __construct($param = null)
{
parent::__construct();
// creates the form
$this->form = new BootstrapFormBuilder(self::$formName);
// define the form title
@scriptdev
scriptdev / .php
Last active April 20, 2024 00:17
ATUALIZAÇÃO AUTOMÁTICA DOS REGISTROS DO DATAGRID APÓS x TEMPO
<?php
public function __construct($param = null)
{
parent::__construct();
// creates the form
$this->form = new BootstrapFormBuilder(self::$formName);
// define the form title
@scriptdev
scriptdev / .php
Last active April 20, 2024 00:15
SIMULAR O CLIQUE NO BOTÃO VIA JAVASCRIPT
<?php
# DEFINE O ID DO BOTÃO
$button_entrar->id = 'tbutton_btn_entrar';
# jQUERY
TScript::create('$("#tbutton_btn_entrar").click();');
# JAVASCRIPT
TScript::create('document.getElementById("tbutton_btn_entrar").click();');
@lvxianchao
lvxianchao / npm.taobao.sh
Last active April 20, 2024 00:15
设置 npm 和 yarn 的镜像源为淘宝镜像源
# ==========================================================
# NPM
# ==========================================================
npm set registry https://registry.npmmirror.com # 注册模块镜像
npm set disturl https://npmmirror.com/mirrors/node # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set sass_binary_site https://registry.npmmirror.com/mirrors/node-sass # node-sass 二进制包镜像
npm set electron_mirror https://registry.npmmirror.com/mirrors/electron/ # electron 二进制包镜像
@scriptdev
scriptdev / .php
Last active April 20, 2024 00:14
ADICIONAR COR DE FUNDO NA COLUNA DO DATAGRID
<?php
// CRIE UMA TRANSFORMAÇÃO NA COLUNA DO DATAGRID
$column_situacao->setTransformer(function($value, $object, $row)
{
$label = '';
$class = '';
switch ($value) {
@sakamaki-kazuyoshi
sakamaki-kazuyoshi / DescribeExportTask.py
Last active April 20, 2024 00:12
Export CloudWatch Logs with Step Functions
import boto3
import logging
logs_client = boto3.client('logs')
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def lambda_handler(event, context):
task_id = event['iterator']['task_id']
@allsey87
allsey87 / python_plugin.rs
Last active April 20, 2024 00:12
Integrating RustPython into a Bevy App
use bevy::prelude::{AppBuilder, Entity, With, World};
use bevy::ecs::system::IntoExclusiveSystem;
use rustpython_vm::{self as vm, builtins::PyCode, PyRef, scope::Scope};
pub(crate) struct PythonPlugin;
pub(crate) struct Script(pub String);
fn compile(world: &mut World) {
let interpreter = world
Readme: In the following pseudo code, [] indicates a subroutine.
Sometimes I choose to write the subroutine inline under the [] in order to maintain context.
One important fact about the way rollbacks are handled here is that we are storing state for every frame.
In any real implementation you only need to store one game state at a time. Storing a game
state for every frame allows us to only rollback to the first frame where the predicted inputs don't match the true ones.
==Constants==
MAX_ROLLBACK_FRAMES := Any Positive Integer # Specifies the maximum number of frames that can be resimulated
FRAME_ADVANTAGE_LIMIT := Any Positive Integer # Specifies the number of frames the local client can progress ahead of the remote client before time synchronizing.
@scyto
scyto / proxmox-tb-net.md
Last active April 20, 2024 00:08
Thunderbolt Networking Setup

Thunderbolt Networking

this gist is part of this series

NOTE FOR THIS TO BE RELIABLE ON NODE RESTARTS YOU WILL NEED PROXMOX KERNEL 6.2.16-14-pve OR HIGER

This fixes issues i bugged with the thunderbolt / thunderbolt-net maintainers (i will take everyones thanks now, lol)

Install LLDP - this is great to see what nodes can see which.

  • install lldpctl with apt install lldpd
@chriswayg
chriswayg / Ubuntu_Debian_Cloud_images_in_Proxmox.md
Last active April 20, 2024 00:05
Ubuntu and Debian Cloud images in Proxmox