Skip to content

Instantly share code, notes, and snippets.

View nebkam's full-sized avatar

Nebojša Kamber nebkam

View GitHub Profile
@burka
burka / removeNullProperties.js
Created May 10, 2017 15:20
Remove null properties from javascript objects
"use strict";
export default function removeNullProperties(obj) {
Object.keys(obj).forEach(key => {
let value = obj[key];
let hasProperties = value && Object.keys(value).length > 0;
if (value === null) {
delete obj[key];
}
else if ((typeof value !== "string") && hasProperties) {
@lopspower
lopspower / README.md
Last active May 7, 2024 23:40
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@jemshit
jemshit / text_colors.xml
Last active March 21, 2021 01:07
Android Text Colors according to Material Design Pattern
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Dark Text Color for Light Background -->
<color name="textDarkPrimary">#DE000000</color> <!--DE for %87 opacity-->
<color name="textDarkSecondary">#8A000000</color> <!--8A for %54 opacity-->
<color name="textDarkDisabled">#61000000</color> <!--61 for %38 opacity-->
<!-- White Text Color for Dark Background -->
<color name="textLightPrimary">#FFFFFF</color> <!--%100 opacity-->
@jamesmoey
jamesmoey / ExtendedArrayCollection.php
Last active July 24, 2023 07:02
Extend array collection from Doctrine with operation to perform on all the item in the collection.
<?php
namespace Collections;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\PropertyAccess\PropertyAccess;
class ExtendedArrayCollection extends ArrayCollection
{
/**