Skip to content

Instantly share code, notes, and snippets.

View morriekken's full-sized avatar
🏠
Working from home

Rafal Ziolkowski morriekken

🏠
Working from home
View GitHub Profile
@Ellisonlee
Ellisonlee / RealPathUtil.java
Last active April 19, 2022 00:39 — forked from tatocaster/RealPathUtil.java
Real Path Utility class for Android, works for all API
public class RealPathUtil {
public static String getRealPath(Context context, Uri fileUri) {
String realPath;
// SDK < API11
if (Build.VERSION.SDK_INT < 11) {
realPath = RealPathUtil.getRealPathFromURI_BelowAPI11(context, fileUri);
}
// SDK >= 11 && SDK < 19
else if (Build.VERSION.SDK_INT < 19) {
@morriekken
morriekken / PowerShellOneliners.ps1
Last active April 10, 2019 06:35
PowerShell one line snippets
# Get first 10 lines
Get-Content ./log.log -First 10
# Get last 10 lines
Get-Content ./log.log -Tail 10
# Get last 10 lines and wait for new to arrive
Get-Content ./log.log -Wait -Tail 10
# Search for string in files in current directory and subdirectories
@Beefster09
Beefster09 / scale.frag
Last active October 29, 2021 00:34
GLSL: smooth pixel scaling
#version 330 core
in vec2 frag_uv;
uniform sampler2D virtual_screen;
uniform float sharpness = 2.0;
out vec4 frag_color;
float sharpen(float pix_coord) {
@JohannesMP
JohannesMP / LICENSE
Last active March 9, 2024 11:26
[Unity3D] A Reliable, user-friendly way to reference SceneAssets by script.
/*******************************************************************************
* Don't Be a Jerk: The Open Source Software License.
* Adapted from: https://github.com/evantahler/Dont-be-a-Jerk
*******************************************************************************
* _I_ am the software author - JohannesMP on Github.
* _You_ are the user of this software. You might be a _we_, and that's OK!
*
* This is free, open source software. I will never charge you to use,
* license, or obtain this software. Doing so would make me a jerk.
*
@xDavidLeon
xDavidLeon / ToonDeferredShading2017.shader
Created May 18, 2017 14:43
Unity 5.6 Deferred Cel Shading Modification
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Modifications by David Leon. Copyright (c) 2017 Lince Works SL. MIT license (see license.txt)
Shader "ToonDeferredShading2017" {
Properties {
_LightTexture0 ("", any) = "" {}
_LightTextureB0 ("", 2D) = "" {}
_ShadowMapTexture ("", any) = "" {}
_SrcBlend ("", Float) = 1
_DstBlend ("", Float) = 1
@oledid
oledid / turn-off-screen.ps1
Created September 24, 2015 07:15
PowerShell: Turn off computer screen
# Source: http://www.powershellmagazine.com/2013/07/18/pstip-how-to-switch-off-display-with-powershell/
# Turn display off by calling WindowsAPI.
# SendMessage(HWND_BROADCAST,WM_SYSCOMMAND, SC_MONITORPOWER, POWER_OFF)
# HWND_BROADCAST 0xffff
# WM_SYSCOMMAND 0x0112
# SC_MONITORPOWER 0xf170
# POWER_OFF 0x0002
@jgornick
jgornick / countries.json
Created January 5, 2011 18:33
SQL: ISO 3166-1 Country Codes
{
"countries" : [
{
"code": "ZW",
"name": "Zimbabwe"
},
{
"code": "ZM",
"name": "Zambia"
},