Skip to content

Instantly share code, notes, and snippets.

View derme302's full-sized avatar

Chris derme302

View GitHub Profile
@derme302
derme302 / GoogleMap.cs
Last active May 4, 2025 02:21
Load a Google Map into Unity3D
/*
* Based on the Google Maps for Unity Asset
* https://www.assetstore.unity3d.com/en/#!/content/3573
* However the relience on UniWeb has been removed
*
*
Getting Started
---------------
1. Assign the GoogleMap component to your game object.
@derme302
derme302 / .gitignore
Last active August 29, 2015 14:12 — forked from kleber-swf/.gitignore
[Unity] .gitignore
# =============== #
# Unity generated #
# =============== #
[Tt]emp/
[Oo]bj/
[Bb]uild
[Ll]ibrary/
sysinfo.txt
# ===================================== #
@derme302
derme302 / CSVReader.cs
Created January 28, 2015 04:51
Allows a CSV to be imported into Unity
// Built on http://bravenewmethod.com/2014/09/13/lightweight-csv-reader-for-unity/
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text.RegularExpressions;
public class CSVReader
{
static string SPLIT_RE = @",(?=(?:[^""]*""[^""]*"")*(?![^""]*""))";
@derme302
derme302 / ds_grid_import_array
Created January 29, 2015 10:04
Import a array into a ds_grid
///ds_grid_import_array(ds_grid, array)
var grid = argument[0];
var arr = argument[1];
// Calculate array Size
var height = array_height_2d(arr);
var width = 0;
for (var i = 0; i < height; i++) {
if (array_length_2d(arr, i) > width)
width = array_length_2d(arr, i);
@derme302
derme302 / .gitignore
Created February 24, 2015 02:02
Windows/Mac gitignore
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
@derme302
derme302 / README.md
Last active February 23, 2025 19:51
Install rtl_433 for a SDR-RTL Dongle on a Raspberry Pi
@derme302
derme302 / scaling.gml
Created May 28, 2022 22:20
Automatically set all the views in all your Game Maker Studio 2 rooms so that you only need to call it once at the start of the game.
// Reference: https://gamemaker.io/en/blog/the-basics-of-scaling-the-game-view
function display_scale_all_rooms() {
var base_w = 1024;
var base_h = 768;
var max_w = display_get_width();
var max_h = display_get_height();
var aspect = display_get_width() / display_get_height();
if (max_w < max_h) {
// portait
var VIEW_WIDTH = min(base_w, max_w);
@derme302
derme302 / bing.py
Created June 7, 2022 23:34
Download wallpaper from Bing
import requests
from requests.exceptions import RequestException
from lxml import etree
from io import BytesIO
BING_URL = "https://www.bing.com/"
def bing_get_wallpaper_url(debug = True):
@derme302
derme302 / git-sync.sh
Created September 1, 2022 22:57
Sync a folder with Git and add a message with the timestamp
#!/bin/bash
git pull
git add --all
git commit -asm "`date +'%a %d %b %Y %H:%M:%S'`"
git push
import glob
import time
import paho.mqtt.publish as mqtt
base_dir = '/sys/bus/w1/devices/'
device_folder = glob.glob(base_dir + '28*')[0]
device_file = device_folder + '/w1_slave'
def read_temp_raw():