Skip to content

Instantly share code, notes, and snippets.

View mehmet6parmak's full-sized avatar

Mehmet Altıparmak mehmet6parmak

View GitHub Profile
@bradtraversy
bradtraversy / ssh.md
Last active March 6, 2024 21:45
SSH & DevOps Crash Course Snippets

SSH Cheat Sheet

This sheet goes along with this SSH YouTube tutorial

Login via SSH with password (LOCAL SERVER)

$ ssh brad@192.168.1.29

Create folder, file, install Apache (Just messing around)

$ mkdir test

$ cd test

@sebaslogen
sebaslogen / LiveObservable.kt
Created July 9, 2017 21:15
LiveObservable: Android lifecycle aware wrapper for an RxJava Observable
import android.arch.lifecycle.Lifecycle
import android.arch.lifecycle.LifecycleObserver
import android.arch.lifecycle.LifecycleOwner
import android.arch.lifecycle.OnLifecycleEvent
import com.jakewharton.rxrelay.BehaviorRelay
import rx.Observable
import rx.android.schedulers.AndroidSchedulers
import rx.functions.Action1
import rx.subscriptions.CompositeSubscription
@tsuharesu
tsuharesu / AddCookiesInterceptor.java
Last active January 8, 2024 07:39
Handle Cookies easily with Retrofit/OkHttp
/**
* This interceptor put all the Cookies in Preferences in the Request.
* Your implementation on how to get the Preferences MAY VARY.
* <p>
* Created by tsuharesu on 4/1/15.
*/
public class AddCookiesInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
@alexfu
alexfu / DividerItemDecoration.java
Last active February 9, 2023 05:09
An ItemDecoration that draws dividers between items. Pulled from Android support demos.
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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
@JakeWharton
JakeWharton / OkHttpStack.java
Created May 21, 2013 01:14
A `HttpStack` implementation for Volley that uses OkHttp as its transport.
import com.android.volley.toolbox.HurlStack;
import com.squareup.okhttp.OkHttpClient;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* An {@link com.android.volley.toolbox.HttpStack HttpStack} implementation which
* uses OkHttp as its transport.
*/
@robcowie
robcowie / countries.csv
Created April 4, 2011 14:05
Create a table of Countries with ISO codes
alpha2 alpha3 numeric name
AF AFG 004 Afghanistan
AX ALA 248 Åland Islands
AL ALB 008 Albania
DZ DZA 012 Algeria
AS ASM 016 American Samoa
AD AND 020 Andorra
AO AGO 024 Angola
AI AIA 660 Anguilla
AQ ATA 010 Antarctica