Skip to content

Instantly share code, notes, and snippets.

Avatar

NiklasRosenstein

View GitHub Profile
View generate-password.py
import string
import random
DEFAULT_POOLS = [
string.ascii_lowercase,
string.ascii_uppercase,
string.digits,
'_!@$'
]
View Windows Hacks.md

Downgrade Windows 10

https://www.youtube.com/watch?v=VTjLd57QgDY

In the following RegEdit keys

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
  • HKEY_LOCAL_MACHINE\WOW6432Node\SOFTWARE\Microsoft\Windows NT\CurrentVersion

Edit the following values:

@NiklasRosenstein
NiklasRosenstein / github-watch-all.py
Created Jun 19, 2018
Watch all repositories that you have read/write/admin access to.
View github-watch-all.py
import requests
API = 'https://api.github.com'
session = requests.Session()
session.auth = ('YourUsername', 'YourPassword')
def repos():
page = 0
while True:
@NiklasRosenstein
NiklasRosenstein / asyncio_rlock.py
Last active Dec 28, 2017
This is just hacked together real quick, not 100% production proven.
View asyncio_rlock.py
import asyncio
class RLock(asyncio.Lock):
"""
A reentrant lock for Python coroutines.
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._task = None
View jiratime.py
# Copyright (C) 2017 Niklas Rosenstein
#
# 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
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
View argument_parser.cpp
/* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
View c4d-webbrowser.py
# Copyright (c) 2017 Niklas Rosenstein
#
# 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
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
View gogs-upgrade.sh
#!/bin/bash
VERSION=$1
if [ -z "$VERSION" ]; then
echo "no version specified"
exit 1
fi
.local/bin/nocrux gogs stop
wget https://dl.gogs.io/$VERSION/linux_amd64.tar.gz
View pip-cmdline.py
# Copyright (c) 2017 Niklas Rosenstein
#
# 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
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
@NiklasRosenstein
NiklasRosenstein / complex.frag
Last active Mar 28, 2019
Functions for complex numbers in GLSL. https://www.shadertoy.com/
View complex.frag
vec2 cmpxcjg(in vec2 c) {
return vec2(c.x, -c.y);
}
vec2 cmpxmul(in vec2 a, in vec2 b) {
return vec2(a.x * b.x - a.y * b.y, a.y * b.x + a.x * b.y);
}
vec2 cmpxpow(in vec2 c, int p) {
for (int i = 0; i < p; ++i) {
You can’t perform that action at this time.