Skip to content

Instantly share code, notes, and snippets.

View michael811125's full-sized avatar

MichaelO michael811125

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<title>Rebane's Discord Colored Text Generator</title>
<meta charset="UTF-8">
<meta name="description" content="Rebane's Discord Colored Text Generator">
<meta name="author" content="rebane2001">
<style>
/*
@michael811125
michael811125 / config.toml
Created November 28, 2024 09:13 — forked from ryankurte/config.toml
Set gitlab runner to use git bash
[[runners]]
name = "tt708-windows"
url = "https://gitlab.com/"
token = "[REDACTED]"
executor = "shell"
shell = "bash"
builds_dir="/c/gitlab-runner/builds/"
cache_dir="/c/gitlab-runner/cache/"
[runners.cache]
[runners.cache.s3]
@michael811125
michael811125 / ScrollRectExtensions.cs
Created August 2, 2024 06:28 — forked from Sov3rain/ScrollRectExtensions.cs
Tell the Unity Scroll Rect View to snap to the given element (top).
using UnityEngine;
using UnityEngine.UI;
public static class ScrollRectExtensions
{
/// <summary>
/// Tell the Scroll Rect View to snap to the given element (top).
/// </summary>
public static void SnapTo(
this ScrollRect scrollRect,
@michael811125
michael811125 / async.cs
Created March 18, 2024 05:53 — forked from JasonMore/async.cs
HttpWebRequest sync/async
public async Task<string> GetResponseAsStringAsync(HttpWebRequest webRequest, string post = null)
{
if (post != null)
{
webRequest.Method = "POST";
using (Stream postStream = await webRequest.GetRequestStreamAsync())
{
byte[] postBytes = Encoding.ASCII.GetBytes(post);
await postStream.WriteAsync(postBytes, 0, postBytes.Length);
await postStream.FlushAsync();
@michael811125
michael811125 / FullscreenGameView.cs
Created February 27, 2024 03:27 — forked from Chillu1/FullscreenGameView.cs
FullscreenGameView utility, for automatic fullscreen on play with toggle option (Game view fullscreen in editor)
/*
MIT License
Copyright (c) 2021 Chillu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@michael811125
michael811125 / aes_example.cs
Created October 29, 2023 06:56 — forked from mark-adams/aes_example.cs
AES String Encryption (CBC) Example Code for C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace aes_example
{
using System;
@michael811125
michael811125 / MonoBehaviourSingleton.cs
Created October 20, 2023 07:27 — forked from rickyah/MonoBehaviourSingleton.cs
MonoBehaviour Singleton
using System;
using UnityEngine;
/// <summary>
/// This is a generic Singleton implementation for Monobehaviours.
/// Create a derived class where the type T is the script you want to "Singletonize"
/// Upon loading it will call DontDestroyOnLoad on the gameobject where this script is contained
/// so it persists upon scene changes.
/// </summary>
/// <remarks>
@michael811125
michael811125 / .gitattributes
Created July 21, 2023 07:54 — forked from nemotoo/.gitattributes
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
gitlab-rails console production
user = User.create(:username=>'root',:password=>'xXxXx',:password_confirmation=>'',:email=>'[email protected]',:name=>'root')
user.save!
@michael811125
michael811125 / PointGizmo.cs
Created July 8, 2023 02:30
Easy Gizmos for Unity
using UnityEngine;
public class PointGizmo : MonoBehaviour
{
enum DrawType
{
Solid,
Wire
}