Skip to content

Instantly share code, notes, and snippets.

View dzolnai's full-sized avatar

Dániel Zolnai dzolnai

  • Egeniq
  • Budapest
View GitHub Profile
public class PracticalInfoFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_practical_info, container, false);
TextView practicalInfo = (TextView)view.findViewById(R.id.practical_info);
practicalInfo.setMovementMethod(LinkMovementMethod.getInstance());
String infoString = _readStringFromAssets(); // Not detailed here, content can be seen in the other file below
_setTextViewLinks(practicalInfo, infoString);
return view;
@dzolnai
dzolnai / cadvisor
Last active February 26, 2016 14:41
cAdvisor init.d service
#!/bin/sh
### BEGIN INIT INFO
# Provides: cadvisor
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
@dzolnai
dzolnai / AnimatableInsetDrawable
Created January 24, 2016 14:30
A modified copy of the original Android InsetDrawable which allows setting the insets from a public method
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@dzolnai
dzolnai / AutoHotKey.ahk
Last active May 13, 2025 16:40
AutoHotKey for remapping Windows + 1, 2, 3... to Windows + Q, W, E...
; Windows + Q calls Windows + 1
#q::
Send {LWin Down}1
Sleep 200
While GetKeyState("LWin","P")
{
KeyWait, q, D T0.3
If !ErrorLevel ; if you do press q
{
Send {Blind}1
@dzolnai
dzolnai / OAuthClient.java
Last active August 18, 2021 07:23
Retrofit OAuth2 refreshing tokens without modifying all requests.
package com.example.yourapp;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.example.yourapp.AuthenticationModel;
import retrofit.client.Header;
import retrofit.client.OkClient;