Skip to content

Instantly share code, notes, and snippets.

we all shine in different ways

Madina MadinaB

we all shine in different ways
View GitHub Profile
MadinaB / ConcurrentModificationException
Created Jan 6, 2019
View ConcurrentModificationException
import java.util.*;
public class MyClass {
public static void main(String args[]) {
LinkedList<Integer> list = new LinkedList<>();
Iterator key = list.listIterator(0);
View git-commands
.gitignore file
To see the file in folder make 'ls a', to modify do 'vi .gitignore file'. Use this file to insert there full pathes and names of folders/files/objects you would not want to commit to the repo.
git init
To create a new, empty repository in the current directory
git status
Shows status of current repo
git log
MadinaB / gist:1b71082babea80cad96bcfde66dc18b5
Created May 5, 2018
Getting height of a view in OnCreate()
View gist:1b71082babea80cad96bcfde66dc18b5
final View view=//smth;
... Runnable() {
public void run() {
view.getHeight(); //height is ready
MadinaB / DrawingGist
Last active May 5, 2018
Tips on Drawing on Android
View gist:d90532c0b1a193995a805a472a9f24e8
package com.madinabektayeva.stepcounter;
import android.content.Context;
import android.hardware.*;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;
View #1
background.js :
if (!localStorage.isInitialized) {
localStorage.isInitialized = true;
localStorage.setItem('LatestDate', '');
localStorage.setItem('currentWebsites', '{}');
View Deleting pushed merge and commit from original repository and commit history on GitHub
I have to delete 2 last commits pushed to original repo, one of which is a merge commit. I want to delete changes in repo and keep them on my computer.
When I do
git revert -m 1 075cc2f
It adds a revert commit to my history of commits and my 075cc2f commit is still present there.
When I do
git push origin +HEAD^:master
commit is fully deleted from history.
View STL algotirhtms
max_element(iter1, iter2)
min_element(iter1, iter2)
random_shuffle(iter1, iter2)
sort(iter1, iter2)