Skip to content

Instantly share code, notes, and snippets.

View Anduin2017's full-sized avatar

Anduin Xue Anduin2017

View GitHub Profile
@Anduin2017
Anduin2017 / .lua
Created August 7, 2022 13:49
TrueShade.Lua LKG
-- T r u e S h a d e --
-- set( "sim/private/controls/caps/dynamic_shadow", 1.00)
set( "sim/private/controls/clouds/cloud_shadow_lighten_ratio", 1.00)
set( "sim/private/controls/clouds/shad_alpha_dry", 0.9 )
set( "sim/private/controls/clouds/shad_alpha_wet", 1.90 )
set( "sim/private/controls/clouds/shad_radius", 0.70 )
set( "sim/private/controls/clouds/shadow_size", 2048.0 )
get_code()
{
folder="$1"
branch_name="$2"
cd $folder
git reset --hard HEAD
git clean . -fdx
git fetch
git checkout -b $branch_name origin/$branch_name
git checkout $branch_name
@Anduin2017
Anduin2017 / powerful-pe.ps1
Last active October 13, 2021 08:37
powerful pe
New-Item -Path "C:\Temp" -Type Directory
Dism /Mount-Image /ImageFile:"E:\sources\boot.wim" /Index:2 /MountDir:"C:\Temp"
$cabs = Get-ChildItem "*.cab" -Path "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs"
foreach($cab in $cabs) {
Dism /Add-Package /Image:"C:\Temp" /PackagePath:"$($cab.VersionInfo.FileName)"
}
$cabs = Get-ChildItem "*.cab" -Path "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\en-us"
foreach($cab in $cabs) {
#!/bin/bash
#
# Script migración desde Fontawesome v4 a Fontawesome v5
#
# Modo de uso
# ./fontawesome4to5.sh [-d DIRECTORIO] [-e EXTENSION] [-v]
#
# Si no se especifica DIRECTORIO, se hará el reemplazo en el directorio actual
# Si no se especifica EXTENSION, se buscarán por defecto archivos "php"
# Opción -v mostrará los archivos que se van modificando
@Anduin2017
Anduin2017 / index.html
Created June 22, 2020 06:13
Echo back microphone.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>capture microphone audio into buffer</title>
<script type="text/javascript">
var audioContext = new AudioContext();
if (navigator.getUserMedia) {
Effects=AmbientLight.fx,Clarity.fx,DPX.fx,FakeHDR.fx,Sepia.fx
Techniques=AmbientLight,Clarity,DPX,HDR,Tint
TechniqueSorting=AmbientLight,Clarity,DPX,HDR,Tint
[AmbientLight.fx]
alDebug=0
alAdaptBaseMult=0.160000
alInt=1.400000
AL_DirtTex=0
alThreshold=0.000300
# Variables
$DiskID = "/subscriptions/e82a2bbd-7d7c-4fa7-ad47-bc0feef07aa1/resourceGroups/Anduin/providers/Microsoft.Compute/disks/StarDiskWithOS"# eg. "/subscriptions/203bdbf0-69bd-1a12-a894-a826cf0a34c8/resourcegroups/rg-server1-prod-1/providers/Microsoft.Compute/disks/Server1-Server1"
$VMName = "StarX"
$DiskSizeGB = 90
$AzSubscription = "Visual Studio Enterprise – MPN"
# Script
# Provide your Azure admin credentials
Connect-AzAccount
@Anduin2017
Anduin2017 / main.cs
Created July 2, 2019 15:07
Generate object
using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace Generator
{
public abstract class Conversation
@Anduin2017
Anduin2017 / limitIp.cs
Last active September 4, 2019 17:00
Limit IP request frenquency
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
namespace Aiursoft.Pylon.Attributes
{
public class LimitPerMin : ActionFilterAttribute
@Anduin2017
Anduin2017 / main.cs
Created June 24, 2019 07:12
Auto update database in ASP.NET Core
public static IWebHost MigrateDbContext<TContext>(this IWebHost webHost, Action<TContext, IServiceProvider> seeder = null) where TContext : DbContext
{
using (var scope = webHost.Services.CreateScope())
{
var services = scope.ServiceProvider;
var logger = services.GetRequiredService<ILogger<TContext>>();
var context = services.GetService<TContext>();
var configuration = services.GetService<IConfiguration>();
var env = services.GetService<IHostingEnvironment>();