Skip to content

Instantly share code, notes, and snippets.

View whoiscarlo's full-sized avatar

Carlo Nyte whoiscarlo

View GitHub Profile
@whoiscarlo
whoiscarlo / Dockerfile
Last active June 11, 2025 21:03
Example Dockerfile for Golang
## BUILD GO BINARY
FROM golang:1.24-alpine AS builder
## Set the working directory
WORKDIR /go/backend
## Copy necessary directories and files
COPY . .
## Download dependencies
@whoiscarlo
whoiscarlo / hapticWithSequence.ts
Last active April 7, 2025 10:24
Create a sequence of haptics
import * as Haptics from 'expo-haptics';
type CustomMilliseconds = number;
type HapticSequence = 'o' | '0'|''|''|'-'|'=' | CustomMilliseconds;
/**
* Haptic sequence element types:
* - 'o': Medium impact haptic feedback
* - '0': Heavy impact haptic feedback
* - '.': Light impact haptic feedback
@whoiscarlo
whoiscarlo / gist:4c2b19f0ff4489c7e1a25720e0c5b964
Created May 12, 2023 23:26 — forked from pcmoritz/gist:4b0e1be7f2dfcc4e51e2ace50426f67d
Powerpoint create slides for animations while retaining slide numbers
Option Explicit
Sub AddElements()
Dim shp As Shape
Dim i As Integer, n As Integer
n = ActivePresentation.Slides.Count
For i = 1 To n
Dim s As Slide
Set s = ActivePresentation.Slides(i)

Create a new project

poetry new <project-name>

Add a new lib

poetry add <library>

Remove a lib

@whoiscarlo
whoiscarlo / create_image_sequence_read_node.py
Created December 23, 2022 03:06
Nuke - Create a read node from an image sequence
import os
import nuke
def get_padding(seqNumbers):
'''
Get correct number of padding for image sequence
'''
size = len(seqNumbers)
padding = ''

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@whoiscarlo
whoiscarlo / maya_testUI_qt.py
Created June 19, 2019 00:38
Create QT UI In Maya
from PyQt5 import QtWidgets
from PyQt5 import QtCore
from PyQt5 import QtGui
from maya import OpenMayaUI
from sip import wrapinstance
class Test_UI(QtWidgets.QWidget):
def __init__(self, *args, **kwargs):
@whoiscarlo
whoiscarlo / wraps_Demo.py
Last active April 16, 2018 22:25
Creator a decorator that will run a command and even if it fails toggles a state on and off
from functools import wraps
def my_decorator(f):
@wraps(f)
def inner_dec(*args, **kws):
try:
## turn state on
f(*args, **kws)
print('test')
finally:
@whoiscarlo
whoiscarlo / convertQT4toQT5.py
Last active March 13, 2024 12:12
Convert PyQt4 to PyQt5
import os, re, stat, sys, shutil
from PyQt5 import QtWidgets, QtCore
qtWidgets_modules = dir(QtWidgets)
qtCore_modules = dir(QtCore)
def fixFile(line_list):
line_generator = iter(line_list)
changed = False
@whoiscarlo
whoiscarlo / editMayaOutlinerMenuBar.py
Created January 25, 2018 19:02
Edit Maya Outliner MenuBar
from maya import OpenMayaUi as omui
from maya import cmds, mel
import sip
from PyQt5 import QtCore, QtWidgets, QtGui
## Maya pointer to outliner widget
outliner_pointer = omui.MQtUtil.findControl('Outliner')
## Convert outliner maya pointer to QWidget