Skip to content

Instantly share code, notes, and snippets.

Avatar

Mark Grandi mgrandi

  • Arizona, USA
View GitHub Profile
@jonbarrow
jonbarrow / archive.py
Last active April 11, 2021 04:24
Rip SMM1 course data and metadata from Nintendo's servers using NEX
View archive.py
'''
Credit Jonathan Barrow 2021
This will rip courses from SMM1 using NEX to automate the process
Use at your own risk, I am not resposible for any bans
Requires Python 3 and https://github.com/Kinnay/NintendoClients
Licensed under GNU GPLv3
'''
@coolreader18
coolreader18 / segfault.py
Last active May 19, 2023 08:33
CPython segfault in 5 lines of code
View segfault.py
class E(BaseException):
def __new__(cls, *args, **kwargs):
return cls
def a(): yield
a().throw(E)
@briangordon
briangordon / git-review-aliases.txt
Last active September 16, 2022 17:51
Aliases for code reviewing GitHub pull requests using a GitFlow/OneFlow branching model
View git-review-aliases.txt
*****************************************************************************************************************************
Introduction
The code review workflow that I prefer is to check out a feature branch, then `reset --soft` to move the branch HEAD to
just before the changes. That way I still have all of the changes in my working copy, and those exact changes are staged
for commit. My IDE will highlight the changed lines right in the editor and let me click the gutter to view a quick diff.
This is incredibly useful. But problems arise when develop has been merged into a running PR, bringing along a whole bunch
of other unrelated changes that have already been reviewed. I don't want all of those other changes to be highlighted in
my IDE, but I do want them in my working copy.
@leodutra
leodutra / windows-10-git.md
Last active April 20, 2023 12:06
Enable long paths on Windows 10 and Git
View windows-10-git.md

If you run Windows 10 Home Edition you could change you Registry to enable Long Paths.

Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem in regedit and then set LongPathsEnabled to 1.

If you have Windows 10 Pro or Enterprise you could also use Local Group Policies.

Go to Computer Configuration > Administrative Templates > System > Filesystem in gpedit.msc, open Enable Win32 long paths and set it to Enabled.

git config --system core.longpaths true
@mikaelhg
mikaelhg / 01_pkcs12-cacerts-workaround.sh
Last active August 17, 2020 17:47
Workaround for java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
View 01_pkcs12-cacerts-workaround.sh
# Ubuntu 18.04 and various Docker images such as openjdk:9-jdk throw exceptions when
# Java applications use SSL and HTTPS, because Java 9 changed a file format, if you
# create that file from scratch, like Debian / Ubuntu do.
#
# Before applying, run your application with the Java command line parameter
# java -Djavax.net.ssl.trustStorePassword=changeit ...
# to verify that this workaround is relevant to your particular issue.
#
# The parameter by itself can be used as a workaround, as well.
@SMSAgentSoftware
SMSAgentSoftware / Get-WindowsVersion.ps1
Last active December 21, 2022 12:48
Finds the Windows version including Edition, Version and OS Build numbers for local or remote computers
View Get-WindowsVersion.ps1
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$false,
ValueFromPipelineByPropertyName=$true,
ValueFromPipeline=$true
)]
[string[]]$ComputerName = $env:COMPUTERNAME
)
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active April 25, 2023 14:55
Jenkinsfile idiosynchrasies with escaping and quotes
View Jenkinsfile.groovy
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@mid-kid
mid-kid / messagetool.py
Created September 26, 2015 10:34
Unpack and repack Pokemon Super Mystery Dungeon's message.bin
View messagetool.py
from sys import argv
from struct import unpack, unpack_from, pack
from os import makedirs
from os.path import isdir
from json import dumps, loads
def unpack_wchar_str_from(bytes, pos):
string = b""
@u0d7i
u0d7i / disable_vim_auto_visual_on_mouse.txt
Last active May 30, 2023 18:06
Disable vim automatic visual mode on mouse select
View disable_vim_auto_visual_on_mouse.txt
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
my ~/.vimrc for preserving global defaults and only changing one option:
source $VIMRUNTIME/defaults.vim
set mouse-=a
@Jaza
Jaza / Private-pypi-howto
Last active May 18, 2023 14:45
Guide for how to create a (minimal) private PyPI repo, just using Apache with directory autoindex, and pip with an extra index URL.