Skip to content

Instantly share code, notes, and snippets.

View nilandev's full-sized avatar
:octocat:
Busy in making and breaking!

Nilanchala Panigrahy nilandev

:octocat:
Busy in making and breaking!
View GitHub Profile
@nilandev
nilandev / deleteLocalGitBranches.sh
Created July 16, 2020 19:57
Delete all other local branches except master, develop or release/*
#!/bin/bash
# Move to master branch. Delete all other local branches except master, develop, release/* or project/*
# Move to master branch
git checkout master
# Collect branches
branches=()
eval "$(git for-each-ref --shell --format='branches+=(%(refname))' refs/heads/)"
@nilandev
nilandev / Launch Sublime Text 2 or 3 from the Mac OSX Terminal.md
Last active December 6, 2018 12:10
Launch Sublime Text 2 or 3 from the Mac OSX Terminal

Installation

Assuming you installed Sublime in the Applications folder

For Sublime Text 2:

$ open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

For Sublime Text 3:

@nilandev
nilandev / git-cheat-sheet.md
Last active October 12, 2018 02:22
Basic Git Commands Cheat Sheet
@nilandev
nilandev / seo-meta-tags.md
Last active April 15, 2018 22:32
Must have HTML SEO meta tags for your website
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">

Basic SEO

<title>{{ config('app.name') }}</title>
<link rel="canonical" href="https://examople.com/link">

Fixing Mac OS Sierra MySQL Woes

MySQL throwing ERROR 2006 (HY000): MySQL server has gone away?

mysql -u root -p
# enter password

mysql > SET GLOBAL max_allowed_packet=1073741824;
@nilandev
nilandev / MessageConfig.java
Created November 17, 2015 14:39
Spring MVC messageSource configuration via annotation
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
@Configuration
public class MessageConfig {
@Bean
public MessageSource messageSource() {
@nilandev
nilandev / ace-editor.html
Last active January 24, 2024 11:54
How to create multiple instance of Ace Editor in one page?
<style>
#accordion {
height:500px;
}
.ace_editor {
width:600px;
height:300px;
}
</style>
@nilandev
nilandev / CaptureAndroidActivity
Last active August 29, 2015 14:14
Taking Screenshot of current screen and saves on external storage
private void captureScreen() {
View content = findViewById(R.id.content_frame);
Bitmap bitmap = content.getDrawingCache();
File folder = new File(Environment.getExternalStorageDirectory()+ "/Device Info");
boolean success = true;
if (!folder.exists()) {
success = folder.mkdir();
}
if (success) {