Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# mac os is not linux and therefore it is not shipped with gnu command line tools intead with freeBSD version
tool_list=(
# GNU programs non-existing in macOS
"watch"
"wget"
"wdiff"
# "gdb" intel only
@abdularis
abdularis / ImageUtil.java
Created February 26, 2018 11:01
android bitmap slicer
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.
*/
#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 December 13, 2017 23:27
List of material color taken from material.io
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 December 13, 2017 08:56
Android material color resource (taken from material.io)
<?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 July 16, 2017 12:40
Xubuntu 16.04 Cannot Suspend when inactive [GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Permission denied]
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: