Skip to content

Instantly share code, notes, and snippets.

View AshikNesin's full-sized avatar

Ashik Nesin AshikNesin

View GitHub Profile
@AshikNesin
AshikNesin / DisplayOnlyDate.cs
Last active August 29, 2015 13:57
Display only DATE & assign it to TextBox in C#.NET
DateTime dtCurrentDate = new DateTime();
dtCurrentDate = DateTime.Now;
txtCurrentDate.Text = dtCurrentDate.ToShortDateString();
@AshikNesin
AshikNesin / NoMoreShortcut.bat
Created March 30, 2014 10:27
Batch script to remove shortcut virus from Pendrive....... Read More : http://www.hugethoughts.com/create-basic-antivirus/
attrib -r -a -s -h /s /d
attrib -r -a -s -h autorun.inf
del autorun.inf
mkdir autorun.inf
attrib +s +h +r autorun.inf
attrib -s -h -r RECYCLER
rd /s RECYCLER
copy /y NUL RECYCLER
attrib +s +h +r RECYCLER
cacls /P autorun.inf everyone:N
@AshikNesin
AshikNesin / SelfDestruction.c
Created March 30, 2014 10:30
Self Destruction for Windows OS.
#include<stdio.h>
#include<string.h>
#include<windows.h>
#define MAX _MAX_PATH
void SelfDestruct();
int main(int argc, char *argv[])
{
SelfDestruct(*argv);
return 0;
}
@AshikNesin
AshikNesin / DateFormat.cs
Created March 30, 2014 17:44
Convert Date to DD/MM/YYYY format in C#
DateTime date = DateTime.Today;
int day = date.Day;
int month = date.Month;
int year = date.Year;
txtTodayDate.Text= (day.ToString() + "/" + month.ToString() + "/" + year.ToString());
@AshikNesin
AshikNesin / gist:00c5b62110c10ea2b834
Last active August 29, 2015 14:23
Elementory OS Customization & Web Development Setup
<html>
<head>
<title>Site Title</title>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="author" content="">
<meta name="keywords" content="">
<meta property="og:title" content="" />
<meta property="og:type" content="" />
@AshikNesin
AshikNesin / center-button.html
Created August 20, 2015 09:47
Center a button in bootstrap
<div class="text-center">
<input type="button" class="btn btn-ghost btn-ghost-bordered center-block" value="GO BACK" style="width:160px;">
</div>
@AshikNesin
AshikNesin / main.js
Created August 27, 2015 07:48
Bootstrap Menu Collapse on Click
//Source http://stackoverflow.com/questions/16680543/hide-twitter-bootstrap-nav-collapse-on-click
$(function() {
$('.nav a').on('click', function(){
if($('.navbar-toggle').css('display') !='none'){
$(".navbar-toggle").trigger( "click" );
}
});
});
@AshikNesin
AshikNesin / git-clean.md
Created September 10, 2015 09:25
[GIT] Discard ALL uncommited/unstagged files including new file

Basically we need to use git clean command to discard unstagged changes in git.

# To list all the files which will be deleted
git clean -nd .
# To discard them
git clean -fd .
@AshikNesin
AshikNesin / controller_name.rb
Created September 10, 2015 11:02
[Rails 4] Get the current user email id in Devise
class ControllerName < ApplicationController
def index
if current_user
@email = current_user.email
else
redirect_to new_user_session_path, notice: 'You are not logged in.'
end
end
end