Skip to content

Instantly share code, notes, and snippets.

View kitek's full-sized avatar
🏠
Working from home

Marcin Kitowicz kitek

🏠
Working from home
View GitHub Profile
@kitek
kitek / html
Created May 13, 2024 13:15
index.html
<html>
<head>
<style>
body {
background-color: #fff;
font-family: Arial, sans-serif;
}
h1 {
color: #000;
font-size: 2em;
<html>
<head>
<style>
body {
background-color: #fff;
font-family: Arial, sans-serif;
}
h1 {
color: #000;
font-size: 2em;
@kitek
kitek / SwipeToDeleteCallback.kt
Created January 24, 2018 19:21
Example demonstrating how to disable swipe to delete for the particular item.
package pl.kitek.rvswipetodelete
import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.support.v4.content.ContextCompat
import android.support.v7.widget.RecyclerView
import android.support.v7.widget.helper.ItemTouchHelper
@kitek
kitek / TriangleShapeView.kt
Created February 14, 2017 13:10
TriangleShapeView
package your.package.name
import android.content.Context
import android.graphics.*
import android.util.AttributeSet
import android.view.View
class TriangleShapeView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
@kitek
kitek / CircleTransform.kt
Last active April 29, 2020 00:35 — forked from julianshen/CircleTransform.java
CircleTransform for Picasso in Kotlin
/*
* Copyright 2014 Julian Shen
*
* 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
@kitek
kitek / DbHelper.kt
Created June 21, 2016 07:10
Kotlin DbHelper
import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper
class DbHelper(context: Context) : SQLiteOpenHelper(context, "some.db", null, 1) {
override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) {
}
@kitek
kitek / Lista ToDo.md
Created April 20, 2014 09:23
Lista ToDo

Moja lista:

  • zadanie pierwsze
  • zadanie drugie
@kitek
kitek / gist:8150873
Created December 27, 2013 18:36
git log
git log --after=2011-01-01 --before=2011-01-31 --format=format: --shortstat master
@kitek
kitek / vb.sh
Created November 25, 2013 20:57
Load&unload virtual box modules for os x
#!/bin/bash
unload() {
echo -ne "unloading VB modules..."
kextstat | grep "org.virtualbox.kext.VBoxUSB" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxUSB
kextstat | grep "org.virtualbox.kext.VBoxNetFlt" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetFlt
kextstat | grep "org.virtualbox.kext.VBoxNetAdp" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetAdp
kextstat | grep "org.virtualbox.kext.VBoxDrv" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxDrv
}
@kitek
kitek / Table.java
Created October 6, 2013 16:56
Dynamic TableLayout
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
LinearLayout linearLayout = new LinearLayout(getActivity());
linearLayout.setOrientation(LinearLayout.HORIZONTAL);
linearLayout.setLayoutParams(new LinearLayout.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT, AbsListView.LayoutParams.WRAP_CONTENT));
TableLayout table = new TableLayout(getActivity());
table.setLayoutParams(new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT));
for (int i = 0; i < 10; i++) {