Skip to content

Instantly share code, notes, and snippets.

View Mr-Kumar-Abhishek's full-sized avatar

Abhishek Kumar Mr-Kumar-Abhishek

View GitHub Profile
public void actionPerformed(ActionEvent e) {
String command = e.getActionCommand();
if (command.equals("button1")) {
myMethod();
}
}
@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / push-1-minus-commit
Last active August 28, 2015 15:49
remove one last commit from remote only
git push +master^:master
#or...
git push remote +branch^1:remotebranch
@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / stdoutErr.java
Created August 28, 2015 15:56
print stack trace exception in stdout rather than stderr
catch(Exception e) {
e.printStackTrace(System.out);
}
@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / rm_branch_remote
Last active October 7, 2015 06:33
Delete branch from remote only
#from Git v1.7.0, onwards,
git push origin --delete <branch name>
@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / git add -A
Created October 7, 2015 06:48 — forked from bryhaw/git add -A
Git: Adding and removing untracked/tracked files
git add -A" is equivalent to "git add .; git add -u
The important point about "git add ." is that it looks at the working tree and adds all those paths to the staged changes if they are either changed or are new and not ignored, it does not stage any 'rm' actions.
"git add -u" looks at all the currently tracked files and stages the changes to those files if they are different or if they have been removed. It does not add any new files, it only stages changes to already tracked files.
"git add -A" is a handy shortcut for doing both.
Source: http://stackoverflow.com/questions/572549/difference-between-git-add-a-and-git-add
@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / ssh-copy.sh
Created October 26, 2015 10:13
Copy ssh key
xclip -sel clip < ~/.ssh/id_rsa.pub
@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / git-remove-history.sh
Created November 20, 2015 09:43
remove large binary files from git history
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2
#
# retrieved from: http://dound.com/2009/04/git-forever-remove-files-or-folders-from-history/
#
@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / .travis.yml
Created December 15, 2015 07:25 — forked from petrbel/.travis.yml
Travis-CI submodules
# Use https (public access) instead of git for git-submodules. This modifies only Travis-CI behavior!
# disable the default submodule logic
git:
submodules: false
# use sed to replace the SSH URL with the public URL, then init and update submodules
before_install:
- sed -i 's/[email protected]:/https:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive
@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / arduino_robot
Created December 21, 2015 06:12 — forked from whyisjake/arduino_robot
Arduino Robot Code
/*
Original code by Nick Brenn
Modified by Marc de Vinck
Make Projects Arduino-based 4WD robot
http://makeprojects.com/Project/Build-your-own-Arduino-Controlled-Robot-/577/1
*/
#include <AFMotor.h>
AF_DCMotor motor1(1, MOTOR12_8KHZ);
AF_DCMotor motor2(2, MOTOR12_8KHZ);
AF_DCMotor motor3(3, MOTOR12_1KHZ);
@Mr-Kumar-Abhishek
Mr-Kumar-Abhishek / woof-CE-patch-generator.sh
Last active December 30, 2015 03:35
Woof CE patch generator by @mavrothal
#!/bin/bash
# A script to generate woof-CE patches against a running puppy (run without
# any arguments) or the puppy.sfs (run with the 'sfs' argument).
Version=0.7
. /etc/DISTRO_SPECS
. /etc/rc.d/PUPSTATE
# Check if we are good to run