Skip to content

Instantly share code, notes, and snippets.

View devinterx's full-sized avatar
🏠
Working from home

Dimitriy devinterx

🏠
Working from home
  • Spain
View GitHub Profile
use tokio::{runtime::Builder, sync::{mpsc}};
use winit::{event::{Event, WindowEvent}, event_loop::{ControlFlow, EventLoop}, window::{Window, WindowBuilder}};
pub struct Gpu {
pub surface: wgpu::Surface,
pub device: wgpu::Device,
pub queue: wgpu::Queue,
pub sc_desc: wgpu::SwapChainDescriptor,
pub swap_chain: wgpu::SwapChain,
@devinterx
devinterx / dataview-polyfill.js
Created May 8, 2024 20:43 — forked from tjmehta/dataview-polyfill.js
DataView (and ArrayBuffer) polyfill that works in any engine (including old IE).
void function(global){
if ('DataView' in global && 'ArrayBuffer' in global) {
return;
}
var hide = (function(){
// check if we're in ES5
if (typeof Object.getOwnPropertyNames === 'function' && !('prototype' in Object.getOwnPropertyNames)) {
var hidden = { enumerable: false };
@devinterx
devinterx / babele.js
Last active February 25, 2023 22:28
pf2e-ts-rub traits for spells
async function __PF2E_TS_init(_this, wrapped, ...args) {
await wrapped();
return new Promise((resolve, reject) => {
for (let metadata of game.data.packs) {
const collection = `${metadata.packageName}.${metadata.name}`;
if(_this.supported(metadata)) {
const translatedCompendium = _this.packs.get(collection);
const variants = _this.translations.find(t => t.collection === collection)?.variants || [];
if (translatedCompendium && variants?.length > 0) {
@devinterx
devinterx / install-configure-letsencrypt.sh
Created June 16, 2020 11:36 — forked from craigvantonder/install-configure-letsencrypt.md
Install and configure LetsEncrypt on Ubuntu Server 14.04 & 16.04 (Apache)
#!/bin/bash
# https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-14-04
# Download the Let’s Encrypt Client
cd /usr/local/sbin
sudo wget https://dl.eff.org/certbot-auto
sudo chmod a+x /usr/local/sbin/certbot-auto
# Set Up the SSL Certificate
@devinterx
devinterx / .gitignore
Created August 24, 2018 09:29 — forked from kmorcinek/.gitignore
Example .gitignore file I use for C# projects
# Download this file using PowerShell v3 under Windows with the following comand:
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore
# or wget:
# wget --no-check-certificate http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore
# User-specific files
*.suo
*.user
*.sln.docstates
using UnityEngine;
using UnityEngine.UI;
namespace Galaxy.Scripts._3d
{
public class Camera3DController : MonoBehaviour
{
public bool IsMouseControl = true;
public float Distance = 25.0f;
https://storage.googleapis.com/roomful-unity/zwt9cqtzqrh700/1480735951784-thumbnail_480_Chrysanthemum.jpg?Expires=1490443265&GoogleAccessId=storage1%40serious-amulet-131413.iam.gserviceaccount.com&Signature=rTBeJMqMSKsuwfWkJ%2Bd76NhaJ9J2qmyzxnPWcxFgI%2BHRp%2FPeST7cbpi18k0XXRKoULfJ8KmkA8LvpDzBWgG2oWU3jk%2BWOaC8C2IbFywUAUjFIZowjmjyJ0Auee14fkDbciQ2RdYypT%2F7m%2BG1yHmZGISnAG6LA5sUIw03GDdUqZhfAfTnZUlX4uEIwQsbobbyP0tiEry9yde4LjUm15NbIeUtF2ldtxiREuaJA%2B6YEWUDppTrywBAadte95y5WHe%2FycHak0aGowth1FDHR3HNdax%2BpfTCHPgM%2FLoNw3i0c%2BpFeuZ0GzmEyAmbs2M5hc8p10Uqo1z6SiR8ZebNQPwMPw%3D%3D
https://storage.googleapis.com/roomful-unity/zwt9cqtzqrh700/1480735951784-thumbnail_480_Chrysanthemum.jpg?Expires=1490443265&GoogleAccessId=storage1%40serious-amulet-131413.iam.gserviceaccount.com&Signature=rTBeJMqMSKsuwfWkJ%2Bd76NhaJ9J2qmyzxnPWcxFgI%2BHRp%2FPeST7cbpi18k0XXRKoULfJ8KmkA8LvpDzBWgG2oWU3jk%2BWOaC8C2IbFywUAUjFIZowjmjyJ0Auee14fkDbciQ2RdYypT%2F7m%2BG1yHmZGISnAG6LA5sUIw03GDdUqZhfAfTnZUlX4uEIwQsbobbyP0tiEry9yde4LjUm15NbIeUtF2ldtxiREu
Hermite.thumbnail = function (buffer, maxSize, type) {
var image = new Image;
image.src = type === undefined ? buffer : 'data:' + type + ';base64,' + buffer;
//console.info(image);
/** @type HTMLCanvasElement|Element */
var canvas = document.createElement('canvas');
canvas.width = image.width;
@devinterx
devinterx / html
Created January 31, 2017 09:27
request fullscreen on canvas
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
SC_HANDLE schSCManager;
LPENUM_SERVICE_STATUS lpS;
DWORD dwBytesNeeded = 0, dwServicesReturned = 0, dwResumeHandle = 0, dwCurService = 0, dwErr;
schSCManager = OpenSCManager(NULL,NULL,SC_MANAGER_ENUMERATE_SERVICE);
if(schSCManager == NULL)
{
printf("\nerror SCM");
return 0;
}