Skip to content

Instantly share code, notes, and snippets.

View vamsee9's full-sized avatar
:octocat:
Just Coding

vamsee. vamsee9

:octocat:
Just Coding
View GitHub Profile
using UnityEngine;
using UnityEngine.EventSystems;
public class FixedButton : MonoBehaviour, IPointerUpHandler, IPointerDownHandler
{
[HideInInspector]
public bool Pressed;
// Use this for initialization
void Start()

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/camera_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:layout_marginBottom="32dp"
android:clickable="true"
android:focusable="true"
app:layout_constraintBottom_toTopOf="@+id/main_add_fab"
app:layout_constraintEnd_toEndOf="parent"
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
//in this you have to declare the functions
private static final String TAG = "MainActivity" ;
FloatingActionButton FabMainAdd, FabCamera, FabImportImage;
Float translationY = 100f;
OvershootInterpolator interpolator = new OvershootInterpolator();
Boolean isMenuOpen = false;
dependencies {
// ...
implementation 'com.google.android.material:material:<version>'
// ...
}
dependencies {
// ...
implementation 'com.google.android.material:material:<version>'
// ...
}
@vamsee9
vamsee9 / permission.java
Last active September 1, 2020 13:28
Custom Settings for 📷 and 📁
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (checkAndRequestPermissions()) {
Log.d(TAG, "onCreate: Permission checking ---------");
}
}
import React, { Component } from "react";
import "./App.css";
import TextField from "@material-ui/core/TextField";
import Button from "@material-ui/core/Button";
const initialState = {
pounds: "",
kilograms: "",
};
import sys
n = int(input())
ar = []
ar2 = []
for a in range(n):
ar.append([int(x) for x in input().split()])
ar2.append([0 for x in range(5)])
navigator.mediaDevices.getUserMedia({ audio: true })
.then(function(stream) {
console.log('You let me use your mic!')
})
.catch(function(err) {
console.log('No mic for you!')
});