Skip to content

Instantly share code, notes, and snippets.

View deda9's full-sized avatar
🍁
Learning is always fun

Bassem Qoulta deda9

🍁
Learning is always fun
View GitHub Profile

SHORTCUTS

Key/Command Description
Tab Auto-complete files and folder names
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + U Clear the line before the cursor
Ctrl + K Clear the line after the cursor
Ctrl + W Delete the word before the cursor
Ctrl + T Swap the last two characters before the cursor
@deda9
deda9 / AppHelper.java
Created October 8, 2016 21:12 — forked from anggadarkprince/AppHelper.java
Upload file with Multipart Request Volley Android
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import java.io.ByteArrayOutputStream;
/**
* Sketch Project Studio
* Created by Angga on 12/04/2016 14.27.
*/
public class AppHelper {
@deda9
deda9 / factory.java
Created July 11, 2016 15:46 — forked from rishi93/factory.java
Design Patterns - Factory Pattern
import java.io.*;
interface Shape
{
public void draw();
}
class Square implements Shape
{
@Override
<VirtualHost *:80>
ServerName myapp.localhost.com
DocumentRoot "/home/vagrant/projects/myapp/public"
<Directory "/home/vagrant/projects/myapp/public">
AllowOverride all
</Directory>
</VirtualHost>
@deda9
deda9 / generics.java
Created July 11, 2016 15:37 — forked from SamDeBlock/generics.java
Generics
public class Generics {
static class Foo<T, R> {
public void bar(T arg) {
System.out.println("T " + arg);
}
public void bar(R arg) {
System.out.println("R " + arg);
}
}
@deda9
deda9 / Box.java
Created July 11, 2016 15:36 — forked from AnnaBoro/Box.java
generics
package lesson7_10.generics;
import java.util.ArrayList;
import java.util.List;
public class Box<T>{
private List<T> birdsList;
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.Log;
import retrofit.client.Client;
import retrofit.client.Header;
import retrofit.client.Request;
import retrofit.client.Response;
import retrofit.mime.TypedInput;
@deda9
deda9 / SimpleListLayout.java
Created June 22, 2016 10:25 — forked from lucasr/SimpleListLayout.java
List layout built with the new TwoWayView API
public class SimpleListLayout extends TwoWayLayoutManager {
public SimpleListLayout(Context context, Orientation orientation) {
super(context, orientation);
}
@Override
protected void measureChild(View child, Direction direction) {
measureChildWithMargins(child, 0, 0);
}
@deda9
deda9 / GridAndListLayout.java
Created June 22, 2016 10:25 — forked from lucasr/GridAndListLayout.java
Mixed grid/list layout built with the new TwoWayView API
public class GridAndListLayout extends TwoWayLayoutManager {
private final int NUM_LANES = 2;
public GridAndListLayout(Context context, Orientation orientation) {
super(context, orientation);
}
private boolean isGridItem(int position) {
return position < 4;
}
@deda9
deda9 / ItemAdapter.java
Created June 22, 2016 01:08 — forked from chRyNaN/ItemAdapter.java
Classes to bridge the gap between RecyclerView and ListView by providing a common API.
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
/**