Skip to content

Instantly share code, notes, and snippets.

@Dudemanguy
Dudemanguy / onscripter-scale-fix.patch
Last active March 12, 2024 01:44
Simple patch for fixing an arthimetic exception that can occur when using the --scale flag in onscripter-en
diff --git a/resize_image.cpp b/resize_image.cpp
index af8866f..ecca1c4 100644
--- a/resize_image.cpp
+++ b/resize_image.cpp
@@ -203,7 +203,11 @@ void resizeImage( unsigned char *dst_buffer, int dst_width, int dst_height, int
x >>= 3;
//avoid resampling from outside the current cell
int ix = mx;
- if (((x+1)%cell_width)==0) ix = 0;
+ if (cell_width == 0) {
@Dudemanguy
Dudemanguy / glib-thumbnailer.patch
Last active February 29, 2024 17:57 — forked from ahodesuka/glib-thumbnailer.patch
Sends a dbus signal for generating thumbnails.
From 01ce72fb8086fb6984e4409739a821408045612e Mon Sep 17 00:00:00 2001
From: Dudemanguy <random342@airmail.cc>
Date: Sat, 24 Feb 2024 15:07:31 -0600
Subject: [PATCH] glocalfileinfo: add a dbus thumbnail generator
---
gio/glocalfileinfo.c | 186 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 179 insertions(+), 7 deletions(-)
diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c
@Dudemanguy
Dudemanguy / diffgene_script.R
Created October 18, 2017 16:37
Script for performing differential gene expression between two groups
library(HTSFilter)
library(edgeR)
suppressPackageStartupMessages(library(DESeq2))
options(max.width=9999999, width=10000)
#define functions
#user input
print("Script for performing differential gene expression between two groups")
count_raw <- readline("Enter the file containing the count matrix \n")
@Dudemanguy
Dudemanguy / complete_query.R
Created October 18, 2017 16:36
Script for quickly searching and fetching terms from GO database
suppressPackageStartupMessages(library(GO.db))
suppressPackageStartupMessages(library(biomaRt))
#script for quickly searching and fetching terms from GO database
query <- readline("Input your search query in regex. \n")
zz <- Ontology(GOTERM)
goterms <- unlist(Term(GOTERM))
whmf <- grep(query, ignore.case=TRUE, goterms)
df <- data.frame(goterms[whmf])
goterm_list <- rownames(df)
@Dudemanguy
Dudemanguy / h.py
Created October 17, 2017 19:02
Python script for calculating the value of Planck's constant, h, and its propagated error from an LED circuit.
import math
import numpy as np
import sys
e = float(1.602176565*10**(-19))
c = float(299792458)
filename = sys.argv[-1]
fin = open(filename, 'r')
V = fin.readline()
@Dudemanguy
Dudemanguy / g.py
Created October 17, 2017 18:57
Python script for calculating the value of g using Krater's Pendulum as well as propagated error.
import math
import numpy as np
import sys
filename = sys.argv[-1]
fin = open(filename,'r')
L1 = fin.readline()
L2 = fin.readline()
T1 = fin.readline()
T2 = fin.readline()
diff --git a/gtk/gtkfilechooserprivate.h b/gtk/gtkfilechooserprivate.h
index a0a622c111..2af859433d 100644
--- a/gtk/gtkfilechooserprivate.h
+++ b/gtk/gtkfilechooserprivate.h
@@ -32,10 +32,14 @@
#include "gtktreestore.h"
#include "gtktreeview.h"
#include "gtkbox.h"
+#include "gtkiconview.h"
+#include "gtkscale.h"
@Dudemanguy
Dudemanguy / gtk2-filechooser-icon-view.patch
Last active December 21, 2020 04:27 — forked from ahodesuka/gtk2-filechooser-icon-view.patch
Adds an icon view to the gtk2 filechooser upload dialog. Generated from https://github.com/Dudemanguy911/gtk/tree/gtk2-filechooser-icon-view
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index c11354248e..a994aa9c6f 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -80,6 +80,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <locale.h>
+#include <math.h>