Skip to content

Instantly share code, notes, and snippets.

@abdularis
abdularis / ImageUtil.java
Created Feb 26, 2018
android bitmap slicer
View ImageUtil.java
package abdularis.github.com.slidingpuzzle;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
/**
* Created by abdularis on 29/12/17.
*/
View change_brightness.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char** argv)
{
// open the file, this might be different depending on the display/graphics card you use
// I use intel graphics card so it's ..intel_backlight..
FILE* file = fopen("/sys/class/backlight/intel_backlight/brightness", "w+");
if (file == NULL)
@abdularis
abdularis / material_color.txt
Created Dec 13, 2017
List of material color taken from material.io
View material_color.txt
Red
red_50 - #FFEBEE
red_100 - #FFCDD2
red_200 - #EF9A9A
red_300 - #E57373
red_400 - #EF5350
red_500 - #F44336
red_600 - #E53935
red_700 - #D32F2F
red_800 - #C62828
@abdularis
abdularis / array.xml
Created Dec 13, 2017
Android material color resource (taken from material.io)
View array.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="mdcolor_50">
<item name="red_50" type="color">#FFEBEE</item>
<item name="ping_50" type="color">#FCE4EC</item>
<item name="purple_50" type="color">#F3E5F5</item>
<item name="deep_purple_50" type="color">#EDE7F6</item>
<item name="indigo_50" type="color">#E8EAF6</item>
<item name="blue_50" type="color">#E3F2FD</item>
<item name="light_blue_50" type="color">#E1F5FE</item>
@abdularis
abdularis / Xubuntu can't sleep fix
Created Jul 16, 2017
Xubuntu 16.04 Cannot Suspend when inactive [GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Permission denied]
View Xubuntu can't sleep fix
Xubuntu 16.04 Cannot Suspend when inactive
[ GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Permission denied ]
At the terminal, type:
xfconf-query -c xfce4-power-manager -lv
If the output of the above command doesn't contain the following line:
/xfce4-power-manager/inactivity-sleep-mode-on-battery 1
then, at the terminal type: