Skip to content

Instantly share code, notes, and snippets.

@dodyg
dodyg / gist:5823184
Last active March 29, 2024 03:59
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@Kartones
Kartones / postgres-cheatsheet.md
Last active May 7, 2024 17:48
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@apolloclark
apolloclark / postgres cheatsheet.md
Last active March 7, 2024 13:53
postgres cheatsheet

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL

@praveenkumar
praveenkumar / squid.conf
Created June 13, 2016 09:14
squid proxy file (/etc/squid/squid.conf)
#
# Recommended minimum configuration:
#
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
# Auth
auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/squid_passwd
package pl.kpob.utils.extensions
import android.app.Activity
import android.content.Context
import android.graphics.Color
import android.support.v4.content.ContextCompat
import android.view.WindowManager
import flow.Flow
import org.jetbrains.anko.AlertDialogBuilder
import pl.sisms.gminformix.utils.extensions.supportsLollipop
@benschwarz
benschwarz / pg.md
Last active December 15, 2020 04:20
Awesome postgres
@jaydenseric
jaydenseric / zeit-now-g-suite-setup.md
Created March 20, 2017 04:46
Zeit Now G Suite setup

Run each of the following lines, replacing yourdomain.com and codehere with your details:

now dns add yourdomain.com @ TXT google-site-verification=codehere
now dns add yourdomain.com @ MX ASPMX.L.GOOGLE.COM 1
now dns add yourdomain.com @ MX ALT1.ASPMX.L.GOOGLE.COM 5
now dns add yourdomain.com @ MX ALT2.ASPMX.L.GOOGLE.COM 5
now dns add yourdomain.com @ MX ALT3.ASPMX.L.GOOGLE.COM 10
now dns add yourdomain.com @ MX ALT4.ASPMX.L.GOOGLE.COM 10
@tpb1908
tpb1908 / Extensions.kt
Created July 3, 2017 19:41
Useful Android Kotlin extension functions
package com.tpb.brainfuck
import android.support.design.widget.FloatingActionButton
import android.support.v7.widget.RecyclerView
import android.text.Editable
import android.text.TextWatcher
import android.util.Log
import android.widget.TextView
/**
@tinmegali
tinmegali / AppDatabse.kt
Last active January 12, 2023 13:44
Android Room @TypeConverter using Kotlin
@Database(entities = arrayOf(Note::class, User::class), version = 1)
@TypeConverters(Converters::class)
abstract class AppDatabse : RoomDatabase() {
abstract fun userDAO(): UserDAO
abstract fun noteDAO(): NoteDAO
}
package peterho.kotlintipstricks
import android.content.Context
import android.support.annotation.AttrRes
import android.support.annotation.StyleRes
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v7.app.AlertDialog
import android.support.v7.widget.RecyclerView
import android.text.TextUtils