Skip to content

Instantly share code, notes, and snippets.

View banasiak's full-sized avatar

Richard Banasiak banasiak

View GitHub Profile
echo Converting $1
mkdir -p res/drawable-mdpi
mkdir -p res/drawable-hdpi
mkdir -p res/drawable-xhdpi
mkdir -p res/drawable-xxhdpi
m=48
h=72
x=96
@amarraja
amarraja / gist:3938304
Created October 23, 2012 11:35
Replace system notepad with notepad++
REM Replaces notepad.exe with notepad++. Here for reference since I can never find it
REM Taken from here: http://blogs.itramblings.com/post/2009/02/08/How-to-replace-notepadexe-on-Windows-Server-2008.aspx
@echo off
echo Create Backup copies of the original notepad.exe
copy C:\Windows\notepad.exe C:\Windows\notepad32.exe
copy C:\Windows\System32\notepad.exe C:\Windows\System32\notepad32.exe
copy C:\Windows\SysWOW64\notepad.exe C:\Windows\SysWOW64\notepad32.exe
@kenmickles
kenmickles / update-digitial-ocean-dns.sh
Last active April 11, 2022 19:47
Shell script to dynamically update a Digital Ocean DNS record
#!/bin/bash
TOKEN="Get token from https://cloud.digitalocean.com/settings/applications"
DOMAIN=example.com
RECORD_ID=12345
IP=`curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+'`
# to get record id:
# curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" "https://api.digitalocean.com/v2/domains/$DOMAIN/records"
@whizzzkid
whizzzkid / XPS-15 9560 Getting Nvidia To Work on KDE Neon
Last active December 3, 2022 15:43
[XPS 15 Early 2017 9560 kabylake] Making Nvidia Drivers + (CUDA 8 / CUDA 9 / CUDA 9.1) + Bumblebee work together on linux ( Ubuntu / KDE Neon / Linux Mint / debian )
# Instructions for 4.14 and cuda 9.1
# If upgrading from 4.13 and cuda 9.0
$ sudo apt-get purge --auto-remove libcud*
$ sudo apt-get purge --auto-remove cuda*
$ sudo apt-get purge --auto-remove nvidia*
# also remove the container directory direcotory at /usr/local/cuda-9.0/
# Important libs required with 4.14.x with Cuda 9.X
$ sudo apt install libelf1 libelf-dev
@ybakos
ybakos / GraphicGlDemoActivity.java
Created November 27, 2012 00:52
A simple example of using an Android Renderer to illustrate OpenGL ES boilerplate.
/* GraphicGlDemoActivity.java
* Author: Yong Bakos
* Since: 11/26/2012
* Thanks to:
* Cube: http://intransitione.com/blog/create-a-spinning-cube-with-opengl-es-and-android/
* OpenGL Boilerplate: http://www.jayway.com/2009/12/03/opengl-es-tutorial-for-android-part-i/
*/
package com.humanoriented.sudoku;
import java.nio.ByteBuffer;
@Karn
Karn / LogController.kt
Last active October 18, 2023 14:59
An example implementation of a process to write logs to disk asynchronously using RxJava
typealias LogElement = Triple<String, Int, String?>
object LogController {
private var flush = BehaviorSubject.create<Long>()
private var flushCompleted = BehaviorSubject.create<Long>()
private var LOG_LEVELS = arrayOf("", "", "VERBOSE",
"DEBUG",
"INFO",
@eyecatchup
eyecatchup / hammerhead-from-lrx21o-to-lrx22c.md
Last active November 1, 2023 08:35
A step-by-step guide how to manually flash the Android 5.0.1 (LRX22C) OTA-Update on a Nexus 5 with modified system (custom recovery/kernel, rooted, modified framework etc.)..

Update: For those interested, here's the version for updating from Android 5.1.0 (LMY47D/LMY47I) to Android 5.1.1 (LMY48B):
https://gist.github.com/eyecatchup/dab5cf7977008e504213


  UPDATE `NEXUS 5` 
     SET `VERSION`='5.0.1', `BUILD`='LRX22C', `RECOVERY`='CUSTOM', `ROOTED`=1 
   WHERE `VERSION`='5.0' && `BUILD`='LRX21O' && `RECOVERY`='CUSTOM' && `ROOTED`=1 
         && `WANNA_KEEP_USERDATA`=1;

Hiding API keys in local.properties

  1. Add the API key to your local.properties file:
apiKey=<value>
  1. Add to the root level of your app-level build.gradle file:
@Jimbly
Jimbly / DefaultKeyBindings.dict
Last active March 6, 2024 16:54
Mac OSX keybindings to more closely match Windows
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more closely
match default behavior on Windows systems.
You must log out and back in to see these changes.
Here is a rough cheatsheet for syntax.
Key Modifiers
^ : Ctrl
$ : Shift