Skip to content

Instantly share code, notes, and snippets.

View DCubix's full-sized avatar
💭
😄

Diego Lopes DCubix

💭
😄
View GitHub Profile
@DCubix
DCubix / Holyrics_Bridge_vMix.vb
Last active February 3, 2024 18:33
Script que permite que o Holyrics se comunique com o vMix, atualizando titles conforme a projeção.
'--
'-- Script para conexão dos dados do Holyrics ao vMix
'-- inclui dados de letra de música e bíblia
'-- autor: Diego Lopes
'-- data: 03/02/2024=
'--
'-- CONFIGURAÇÕES DO HOLYRICS
dim holyricsHost as String = "http://192.168.100.3:8088"
dim holyricsView as String = "stage-view"
@DCubix
DCubix / emojitext.py
Last active May 16, 2019 13:39
Convert text into emoji for Discord
#!/bin/python3
import sys, random
## HOW TO USE:
## python emojitext.py "your text here" zws
## zws: This option is used to enable a zero-width space character to prevent discord from
## converting your characters into flags.
DIGIT = [':zero:', ':one:', ':two:', ':three:', ':four:', ':five:', ':six:', ':seven:', ':eight:', ':nine:']
ALTS = ['ben', 'crap', 'jx9', 'tuts', 'thinking', 'smirk', 'tada', 'snus', 'punk', 'face_palm', 'facepalm', 'clap', 'ok_hand', 'smile', '1234']
#include "sgm_cpu.h"
#include <stdio.h>
#include <assert.h>
#include <memory.h>
#include <math.h>
static sgmByte sgm_cpu_next_byte(sgmCPU* cpu) {
return cpu->ram[SGM_LOC_PROGRAM + (cpu->pc++)] & 0xFF;
}
@DCubix
DCubix / namegen.py
Last active May 1, 2018 21:33
Name generation in Python
import random
from datetime import datetime
random.seed(datetime.now())
CONSONANTS = list("bcdfghjklmnpqrstvwyxz")
VOWELS = list("aeiou")
ALPHABET = CONSONANTS + VOWELS
THIRD_LETTER_PROB = 0.15
@DCubix
DCubix / example.java
Created April 30, 2018 22:11
Clipping for GUI
public boolean beginClipping(int x, int y, int w, int h) {
IDevice dev = Age.Device;
if (!dev.isEnabled(Feature.Scissor)) {
dev.setFeatures(true, Feature.Scissor);
}
if (!clipRectStack.isEmpty()) {
Rectangle parent = clipRectStack.lastElement();
int minX = Math.max(parent.x, x);
int maxX = Math.min(parent.x + parent.width, x + w);
if (maxX - minX < 1) return false;
@DCubix
DCubix / mesher.cpp
Created April 20, 2018 20:05
Mesher
#include "mesher.h"
#include "../core/logging/log.h"
NS_BEGIN
void VertexFormat::put(const String& name, AttributeType type, bool normalized, i32 location) {
VertexAttribute attr;
attr.size = type;
attr.normalized = normalized;
@DCubix
DCubix / cube.obj
Created April 20, 2018 19:53
Cube
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -0.999999
v 0.999999 1.000000 1.000001
v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
vt 1.000000 0.000000
vt 0.000000 1.000000
@DCubix
DCubix / lde.c
Last active April 21, 2018 00:52
Lista Duplamente Encadeada
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
typedef struct Node_t {
int value;
struct Node_t* next;
struct Node_t* prev;
} Node;
#include "Logger.h"
#include <fstream>
#include <assert.h>
#include "termcolor.hpp"
namespace tfx {
#ifdef TFX_DEBUG
Logger Logger::logger = Logger();
@DCubix
DCubix / glcall.rs
Created December 8, 2017 00:12
Macro to call an OpenGL function, check errors and optionally return a value.
#[macro_export]
macro_rules! GL {
($fun:ident ( $($arg:expr),*)) => {{
unsafe {
let result = ::gl::$fun( $($arg),* );
let err = ::gl::GetError();
if err != ::gl::NO_ERROR {
let err_str = match err {
::gl::INVALID_OPERATION => "Invalid Operation",
::gl::INVALID_ENUM => "Invalid Enum",