Skip to content

Instantly share code, notes, and snippets.

View dec04's full-sized avatar
🚧
Construct something

Decoy dec04

🚧
Construct something
View GitHub Profile
@xanscale
xanscale / RoundedBarChart.java
Last active June 21, 2024 14:46
MPAndroidChart BarChart with rounded corner (based from v3.1.0). Just replaced drawRect with drawRoundRect
package com.scarozza;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.RectF;
import android.util.AttributeSet;
import com.github.mikephil.charting.animation.ChartAnimator;
@zmts
zmts / tokens.md
Last active July 17, 2024 07:29
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
public class SingletonClass implements Serializable {
private static volatile SingletonClass sSoleInstance;
//private constructor.
private SingletonClass(){
//Prevent form the reflection api.
if (sSoleInstance != null){
throw new RuntimeException("Use getInstance() method to get the single instance of this class.");
@ccjeng
ccjeng / CustomInfoWindowAdapter.java
Last active February 27, 2024 12:40
Custom InfoWindow Layout for Google Map in Android
public class CustomInfoWindowAdapter implements GoogleMap.InfoWindowAdapter {
private Activity context;
public CustomInfoWindowAdapter(Activity context){
this.context = context;
}
@Override
@tuxfight3r
tuxfight3r / vim-shortcuts.md
Last active July 10, 2024 22:01
VIM SHORTCUTS

VIM KEYBOARD SHORTCUTS

MOVEMENT

h        -   Move left
j        -   Move down
k        -   Move up
l        -   Move right
$        -   Move to end of line
0        -   Move to beginning of line (including whitespace)
@evelyne24
evelyne24 / CustomTextView.java
Last active May 8, 2021 15:40
This is how to get the colour from a custom style within a custom style within an Android Theme.
package org.codeandmagic.android.customtheme;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Color;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
import android.widget.TextView;
@awidegreen
awidegreen / vim_cheatsheet.md
Last active June 17, 2024 03:41
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@evenchange4
evenchange4 / step.md
Created September 23, 2012 21:55
Deploy a Express.js project on Heroku

Deploy a Express.js project on Heroku

Step by step from command line by Michael Hsu

Quick start

Create a Node.js web framework 'express'

$ express myfirstexpress && cd myfirstexpress

Declare dependencies with NPM /package.json