Skip to content

Instantly share code, notes, and snippets.

View neo-sam's full-sized avatar
🎯
Focusing

Neo Sam neo-sam

🎯
Focusing
  • 16:17 (UTC +08:00)
View GitHub Profile
@mhadaily
mhadaily / disable-tab.dart
Created March 7, 2022 16:17
Disable tab index in Flutter
import 'package:flutter/material.dart';
void main() {
runApp(const TabBarDemo());
}
class TabBarDemo extends StatefulWidget {
const TabBarDemo();
@override
@simonholm
simonholm / import_module_appx_powershell7.ps1
Last active December 17, 2022 07:47
powershell 7 import-module appx issue (0x80131539), interim solution
# remove build in apps, source https://www.askvg.com/guide-how-to-remove-all-built-in-apps-in-windows-10/
# don't work with powershell 7 though
# source https://github.com/PowerShell/PowerShell/issues/13138#issuecomment-849965912
import-module appx -usewindowspowershell
# other examples
# source https://github.com/PowerShell/PowerShell/issues/13138#issuecomment-851366340
Import-Module -Name Appx -UseWindowsPowerShell -WarningAction SilentlyContinue
@fffx
fffx / gist:07b2f4f07af0b450be6b49362ac20397
Last active June 10, 2021 04:15
WSL update proxychains config, WSL window host ip
# /etc/proxychains4.conf.example

[ProxyList]
# add proxy here ...
# meanwile
# defaults set to "tor"
socks5 WSL_HOST_IP 1080
@lelegard
lelegard / win-home-gpedit.md
Last active October 8, 2024 12:07
Enabling the Group Policy Editor on Windows 10 Home

Enabling the Group Policy Editor on Windows 10 Home

On Windows 10 Home edition, there is no Local Group Policy Editor (gpedit.msc) and no Local Security Policy Editor (secpol.msc). These tools are reserved to Professional editions of Windows.

It is however possible to install them on Windows 10 Home if you need them.

Open a PowerShell window as administrator and run the following command:

@Espionage724
Espionage724 / 1-Info.txt
Last active October 16, 2024 03:12
Various Windows 10 Batch Files and Notes
Various Windows 10 Batch Files and Notes
- Notably for improving privacy on Windows 10
- Some performance tweaks
@alexdevero
alexdevero / markdown.reg
Last active January 3, 2024 08:48
Add markdown as an item to “New” context menu in Windows 10 (https://superuser.com/questions/638755/add-item-to-new-context-menu-in-windows-8#640486).
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.md]
@="markdown"
[HKEY_CLASSES_ROOT\.md\ShellNew]
"NullFile"=""
[HKEY_CLASSES_ROOT\markdown]
@="Blank Markdown file"
@anthonyeden
anthonyeden / FontInstallation.ps1
Last active October 15, 2024 03:11
Font User Installation - Powershell (No Admin Password Needed)
# Run this as a Computer Startup script to allow installing fonts from C:\InstallFont\
# Based on http://www.edugeek.net/forums/windows-7/123187-installation-fonts-without-admin-rights-2.html
# Run this as a Computer Startup Script in Group Policy
# Full details on my website - https://mediarealm.com.au/articles/windows-font-install-no-password-powershell/
$SourceDir = "C:\InstallFont\"
$Source = "C:\InstallFont\*"
$Destination = (New-Object -ComObject Shell.Application).Namespace(0x14)
$TempFolder = "C:\Windows\Temp\Fonts"
@aojea
aojea / linked-clone.sh
Last active October 29, 2024 03:11
Script to create a linked clone with libvirt
#!/bin/bash
set -xe
# This script takes as a parameter the name of the VM
# and creates a linked clone
# Ref: https://unix.stackexchange.com/a/33584
# The scripts assumes that it runs from the same folder
# where the vm image is located and it coincides with the
# image name
@t2psyto
t2psyto / gist:f5453707d2658173715f49293d096fe5
Created July 14, 2017 04:15
powershell oneliner for encode/decode base64 to file
# encode from binary file to base64txt
powershell -C "& {$outpath = (Join-Path (pwd) 'out_base64.txt'); $inpath = (Join-Path (pwd) 'data.jpg'); [IO.File]::WriteAllText($outpath, ([convert]::ToBase64String(([IO.File]::ReadAllBytes($inpath)))))}"
# decode from base64txt to binary file
powershell -C "& {$outpath = (Join-Path (pwd) 'outdata2.jpg'); $inpath = (Join-Path (pwd) 'out_base64.txt'); [IO.File]::WriteAllBytes($outpath, ([convert]::FromBase64String(([IO.File]::ReadAllText($inpath)))))}"
@thiamteck
thiamteck / remove_namespace_from_xml.sh
Created April 6, 2017 03:06
Remove default namespace declaration from pom.xml
#
# Reference : http://stackoverflow.com/a/16700113/90101
#
#
# remove default namespace declaration
#
sed -e 's/ xmlns=".*"//g' pom.xml
#