Skip to content

Instantly share code, notes, and snippets.

View mudkipme's full-sized avatar

Mudkip mudkipme

View GitHub Profile
@nissel
nissel / WD-HMB64M.reg
Last active November 12, 2024 04:36
Windows 11 Reg fix for SN770, SN580 (and other) HMB force to 64M
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorPort]
"HMBAllocationPolicy"=dword:00000002
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device]
"HostMemoryBufferBytes"=hex(7):56,00,45,00,4e,00,5f,00,31,00,35,00,42,00,37,00,\
26,00,44,00,45,00,56,00,5f,00,35,00,30,00,31,00,37,00,26,00,52,00,45,00,56,\
00,5f,00,3f,00,3f,00,20,00,36,00,37,00,31,00,30,00,38,00,38,00,36,00,34,00,\
00,00,56,00,45,00,4e,00,5f,00,31,00,35,00,42,00,37,00,26,00,44,00,45,00,56,\
import SwiftUI
// Note: There are some issues with using these modifiers inside of ButtonStyles on macOS. Please see https://twitter.com/noahsark769/status/1288256379640139776?s=20 for more info.
struct ConditionalContent<TrueContent: View, FalseContent: View>: View {
let value: Bool
let trueContent: () -> TrueContent
let falseContent: () -> FalseContent
@ViewBuilder var body: some View {
@janlay
janlay / README.md
Last active August 28, 2024 09:44
Yet another config for Surge.app

Install

  1. Modify index.txt with your output path and proxy info
  2. Use Text Builder to build configuration for Surge: $ text-builder -index /path/to/index.txt Or run $ sh build-all to build all your index files.
  3. Import configuration via AirDrop/iTunes/Dropbox/iCloud

本人不提供任何保证和技术支持,使用者自负风险。
There are no guarantees, no any support. Use it at your own risk.

@drblue
drblue / fix_onedrive.sh
Last active August 21, 2024 07:44
Fix OneDrive for Mac CPU usage
#!/bin/bash
## Fix OneDrive for Mac CPU usage
##
## Seems this is still a problem 5 years later after I created this little gist.
## I have long since stopped using OneDrive (luckily), but according to
## comments below, I have added the new path for OfficeFileCache for macOS
## Mojave (10.14) and Catalina (10.15).
## Run this on macOS Mojave (10.14) and Catalina (10.15)
find ~/Library/Containers/ -type d -name OfficeFileCache -exec rm -r {} +
@masahirompp
masahirompp / User.ts
Last active May 5, 2021 20:04
mongoose + typescript
/// <reference path="../tsd/tsd.d.ts" />
import mongoose = require('mongoose');
import passport = require('passport');
interface IUser extends mongoose.Document {
provider: string;
id: string;
authorId: string;
displayName: string;
@aheckmann
aheckmann / prepopulate.js
Created July 27, 2012 21:43
mongoose prepopulate
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var assert = require('assert')
console.log('\n===========');
console.log(' mongoose version: %s', mongoose.version);
console.log('========\n\n');