Skip to content

Instantly share code, notes, and snippets.

View gelldur's full-sized avatar
🎯
Focusing

Gelldur gelldur

🎯
Focusing
View GitHub Profile
@gelldur
gelldur / Grafana Alert Template.md
Last active April 24, 2024 06:14 — forked from Himura2la/Grafana Alert Template.md
How to use Grafana Alerts with the Telegram
  • Template name: telegram.message
  • Content:
    {{- /* Telegram message to use: {{ template "telegram.message2" . }} */ -}}
    {{ define "__alerts_list" -}}
    {{ range . }}
    {{if ne (index .Labels "alertname") "" -}}
    {{ if eq .Status "firing" }}🔴{{ else }}🟢{{ end }}
        {{- if ne (index .Labels "severity") "" -}}
            <u><b>P{{ index .Labels "severity" }}</b></u> {{ end -}}
@gelldur
gelldur / .clang-format
Last active March 27, 2024 16:51
My clang format file. In sample.cpp is sample output
# Checkout config tool: https://zed0.co.uk/clang-format-configurator/
# Or http://cf.monofraps.net/
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# https://github.com/01org/parameter-framework/blob/master/.clang-format
# Tested on: clang-format version 6.0.1
# Common settings
BasedOnStyle: WebKit
@gelldur
gelldur / FullscreenFragment.java
Created September 11, 2015 12:48
FullscreenFragment - simple android fragment that will make fullscreen for you. Remember to: "You must manually call onKeyDown and onWindowFocusChanged."
package com.dexode.fragment;
import android.annotation.TargetApi;
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.view.KeyEvent;
@gelldur
gelldur / HideNavigationBarComponent.java
Last active June 17, 2022 17:56
HideNavigationBarComponent.java
package com.dexode.core.view;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnSystemUiVisibilityChangeListener;
@gelldur
gelldur / ShareIntentBuilder
Last active January 24, 2022 11:12
Share builder for android
package com.dexode.util;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.LabeledIntent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.support.annotation.Nullable;
@gelldur
gelldur / convertRes.py
Created June 27, 2016 14:45
Script converting android res folder to ios assets. Eg. from res to Assets.xcassets
#!/usr/bin/python
import sys
import os
import json
from shutil import copyfile
print('Number of arguments:', len(sys.argv), 'arguments.')
if len(sys.argv) < 3:
@gelldur
gelldur / docker_logs_grep
Created April 18, 2020 08:44
[Grep docker logs] #docker #logs #error #grep
docker logs $container 2>&1 | grep -P "\[(W|E)\]"
Example:
```
04-16 22:04:19.222 [E](StatsApp) Animation has no fills: 1 in 0
04-16 22:27:24.239 [E](StatsApp) Animation has no fills: 1 in 0
```
@gelldur
gelldur / CardView.h
Last active July 11, 2019 13:14
iOS view that looks like CardView from Android
#import <UIKit/UIKit.h>
//Based on: https://github.com/aclissold/CardView
@interface CardView : UIView
@end
@gelldur
gelldur / emulator-fix
Created November 15, 2016 08:46
Fix for android emulator -noaudio and CPU problems
#!/bin/bash
# http://stackoverflow.com/a/35822173/1052261
# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
@gelldur
gelldur / what_i_was_doing_in_last_2w.jql
Last active April 10, 2019 08:53
JQL filter (Jira filter) For what I was doing in last 2 weeks
assignee was currentUser() during (startOfDay(-2w), now()) AND updated >= startOfDay(-2w) AND ( resolutiondate is EMPTY OR resolutiondate >= startOfDay(-2w) )