Skip to content

Instantly share code, notes, and snippets.

View MartinSadovy's full-sized avatar

Martin Sadovy MartinSadovy

View GitHub Profile
@cedrickring
cedrickring / ColoredShadow.kt
Last active April 18, 2024 10:29
Draw a colored shadow in Android Jetpack Compose
/*
Copyright 2020 Cedric Kring.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
<#
.SYNOPSIS
MSI-mode utility
.DESCRIPTION
Main purpose of this script is turning on MSI-mode for all PCI devices in bulk. Script offers four modes which can be selected through following command line arguments:
'on' - turning MSI-mode on;
'off' - turning MSI-mode off;
'reg' - printing reg-file for backup purposes (to save text to reg-file use standard redirection or piplining to comandlet Out-File);
- started without command line argument script prints devices capable for MSI-mode.
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@gbirke
gbirke / ibeacon.sh
Created February 14, 2014 21:50
Init script for iBeacon
#!/bin/sh
### BEGIN INIT INFO
# Provides: ibeacon
# Required-Start: $bluetooth
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: Start/stop Bluetooth iBeacon
### END INIT INFO
@JakubTesarek
JakubTesarek / .bashrc
Last active October 27, 2021 19:59
.bashrc file with useful shortcuts. The file can update itself using `updaterc`. Also contains detection of platform it's running on
# if not running interactively, don't do anything
[ -z "$PS1" ] && return
# Detect platform
platform='unknown'
unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
platform='linux'
elif [[ "$unamestr" == 'FreeBSD' ]]; then
platform='freebsd'
@Mikulas
Mikulas / tips.md
Created July 20, 2013 10:58
Github Markdown Hacks

Images

Inline image without link - simply wrap your images with <a></a>, preventing Github from creating its own link.

<a>![your caption](http://placehold.it/350x150)</a>

With link   Without link

Also note that images served over https:// are not cached, which is useful for changing content without actually editing the image url itself. Example: CI status badges

@lyrixx
lyrixx / post-checkout
Created June 26, 2013 13:37
Git post checkout
#!/bin/bash
# Put this file at: .git/hooks/post-checkout
# and make it executable
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587
PREV_COMMIT=$1
POST_COMMIT=$2
NOCOLOR='\e[0m'
@germanviscuso
germanviscuso / NdefConverter.java
Created January 11, 2012 16:09
NFC utility classes for Android
package android.stickynotes;
import android.nfc.NdefRecord;
public interface NdefConverter {
public NdefRecord asNdef();
}
@springmeyer
springmeyer / degress2meters.js
Last active June 12, 2023 22:50
convert from long/lat to google mercator (or EPSG:4326 to EPSG:900913)
// See https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames for more details.
var degrees2meters = function(lon,lat) {
var x = lon * 20037508.34 / 180;
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
y = y * 20037508.34 / 180;
return [x, y]
}
x= -77.035974