Skip to content

Instantly share code, notes, and snippets.

View teyyihan's full-sized avatar
🙃

Teyyihan Aksu teyyihan

🙃
View GitHub Profile
@subfuzion
subfuzion / curl.md
Last active July 3, 2024 11:43
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@awesometic
awesometic / RSACipher.java
Last active January 11, 2024 07:15
RSA encryption example for android
/**
* Created by Awesometic
* It's encrypt returns Base64 encoded, and also decrypt for Base64 encoded cipher
* references: http://stackoverflow.com/questions/12471999/rsa-encryption-decryption-in-android
*/
import android.util.Base64;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.KeyFactory;
@rharter
rharter / SharedPreferenceLiveData.kt
Last active March 19, 2023 08:15
Creates LiveData objects that observe a value in SharedPreferences while they have active listeners.
import android.arch.lifecycle.LiveData
import android.content.SharedPreferences
abstract class SharedPreferenceLiveData<T>(val sharedPrefs: SharedPreferences,
val key: String,
val defValue: T) : LiveData<T>() {
private val preferenceChangeListener = SharedPreferences.OnSharedPreferenceChangeListener { sharedPreferences, key ->
if (key == this.key) {
value = getValueFromPreferences(key, defValue)
@yancya
yancya / EXCEPT.sql
Created December 15, 2017 11:04
INTERSECT and EXCEPT for BigQuery
#standardsql
WITH a AS (
SELECT * FROM UNNEST([1,2,3,4]) AS n
), b AS (
SELECT * FROM UNNEST([4,5,6,7]) AS n)
SELECT * FROM a
@rajagp
rajagp / custom_couchbase_dev_image.md
Last active October 25, 2022 09:47
Steps to create a custom Couchbase Server Docker Image for development

Purpose

Follow the steps below if you are interested in creating your own custom configurable Couchbase docker image. You will start off with the official Couchbase Enterprise docker image that is available on Docker Hub and use the Couchbase CLI and REST interface to create a custom configurable image.

Credits

This approach inspired by the tutorial. We essentially built a custom docker image from the base Coucbase server image that is configured for our development needs!

Steps

  • Create a new file named DockerFile and open it using an editor of your choice
  • Now add the following lines to the DockerFile.
@nuhkoca
nuhkoca / HiltDataBinding.kt
Last active February 26, 2024 16:33
A demonstration about how to inject BindingAdapters with Dagger Hilt.
BindingScoped.kt
@Scope
@Retention(AnnotationRetention.BINARY)
annotation class BindingScoped
-------------------------------------------------------
CustomBindingComponent.kt