Skip to content

Instantly share code, notes, and snippets.

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

Shohruh abduakhatov

🏠
Working from home
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
@abduakhatov
abduakhatov / Responsive Layout.xml
Created January 23, 2017 13:24
Responsive Layout for different devises
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.shohruh.otherlayouts.MainActivity">
@abduakhatov
abduakhatov / Gesture Detectors.java
Created January 24, 2017 05:54
Identify User Gesture
package com.example.shohruh.eventhandling;
import android.graphics.Color;
import android.support.v4.view.GestureDetectorCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Button;
@abduakhatov
abduakhatov / Equal size .txt
Created January 24, 2017 20:58
Equal size for all consequtive elements
android:layout_alignStart="@+id/firstEditText"
android:layout_alignEnd="@+id/firstEditText"
@abduakhatov
abduakhatov / Git Commands
Created February 1, 2017 09:34
Git commands for creating repository
…or create a new repository on the command line
echo "# Fragments_CreateMeme" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/abduakhatov/Fragments_CreateMeme.git
git push -u origin master
…or push an existing repository from the command line
class BottomBarAdapter : NavBarFragmentStatePagerAdapter<Fragment> {
private val fragments = ArrayList<Fragment>()
constructor(fm: FragmentManager?) : super(fm)
fun addFragments(fragment: Fragment) {
fragments.add(fragment)
}
class App : Application(),HasActivityInjector {
@Inject
lateinit var activityInjector : DispatchingAndroidInjector<Activity>
override fun onCreate() {
super.onCreate()
DaggerAppComponent.builder().application(this).build().inject(this)
}
@abduakhatov
abduakhatov / min-char-rnn.py
Created June 28, 2018 11:35 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
# Alternative to existing logic of
# chech_vehicle_updates
def check_vehicle_updates(dict_simulation_result, current_time):
print('>>> check_vehicle_updates')
cars_free = 0
try:
keys = list(dict_simulation_result)
keys.reverse()
@abduakhatov
abduakhatov / delete_git_submodule.md
Created October 4, 2018 14:37 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule