Skip to content

Instantly share code, notes, and snippets.

@mklimek
mklimek / cloudSettings
Last active August 26, 2020 13:44
vscode settings
{"lastUpload":"2020-08-26T13:44:11.909Z","extensionVersion":"v3.4.3"}
@mklimek
mklimek / javascript.json
Created November 23, 2017 15:55
Visual Studio Code simple unit test snippet using mocha and chai
{
"mocha with chai simple": {
"prefix": "chai",
"body": [
"import {expect} from 'chai'",
"import $1 from '@/$1'",
"\ndescribe('lets test $1', () => {",
"\n\tit('first case', () => {",
"\t\texpect($1).to.not.equal(undefined)",
"\t})",
@mklimek
mklimek / vue.json
Created November 23, 2017 15:52
Visual Studio Code vue component snippet
{
"Vue component": {
"prefix": "vue",
"body": [
"<template>",
"\t<div id=\"$TM_FILENAME_BASE\"><>",
"\t\t$0",
"\t</div>",
"</template>",
"",
@mklimek
mklimek / .gitconfig
Last active July 20, 2022 14:15
simple and useful git aliases
[alias]
ci = commit
co = checkout
st = status
br = branch
gr = log --date=short --oneline --graph --decorate --all
brDetails = branch -va --sort=-committerdate --format='%(authordate:short) %(color:red)%(objectname:short) %(color:yellow)%(refname:short)%(color:reset) (%(color:green)%(committerdate:relative)%(color:reset))'
[color]
ui = true
@mklimek
mklimek / gist:e2627ebd1d0d0d61b25c7c9bf30b0c93
Created April 20, 2016 11:47
Hide garbage generated by logcat output
Paste it into Logact Filter in Android Studio
Log Tag:^(?!(dalvikvm|system_process|InstantRun|libEGL|io.socket.engineio.client|LibraryLoader|art|EGL_emulation|OpenGLRenderer))
@mklimek
mklimek / FrameVideoViewExample.java
Last active April 23, 2019 15:48
frame-viedo-view simple usage with possibility to manipulate MediaPlayer basic actions
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.mklimek.framevideoview.FrameVideoView;
import com.mklimek.framevideoview.FrameVideoViewListener;
@mklimek
mklimek / Example.java
Created March 30, 2016 13:35
SslUtils - example usage
OkHttpClient client = new OkHttpClient();
SSLContext sslContext = SslUtils.getSslContextForCertificateFile("BPClass2RootCA-sha2.cer");
client.setSslSocketFactory(sslContext.getSocketFactory());
@mklimek
mklimek / SslUtils.java
Last active June 11, 2021 00:10
SslUtils - load certificate to SSLContext
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.FileInputStream;
import java.io.InputStream;
import java.security.KeyStore;
import java.security.SecureRandom;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;