Skip to content

Instantly share code, notes, and snippets.

View CaptainOfFlyingDutchman's full-sized avatar
🏗️
Building Josys Microfrontends

Will Turner CaptainOfFlyingDutchman

🏗️
Building Josys Microfrontends
View GitHub Profile
@CaptainOfFlyingDutchman
CaptainOfFlyingDutchman / grails_app_upgrade_from_137_to_244.md
Last active August 29, 2015 14:23
Upgrading a Grails app from version 1.3.7 to version 2.4.4

Upgrading a Grails app from version 1.3.7 to version 2.4.4

So, you want to upgrade your app to Grails 2.4.4 from that legacy 1.3.7 version today!

But wait! There are few challenges waiting for you in the process.

1. Start


Thinking, from where should we start upgrading, as it was quite a task for such

@CaptainOfFlyingDutchman
CaptainOfFlyingDutchman / external_configuration_in_grails_3.md
Last active September 23, 2019 09:19
Enable external configuration in Grails 3

External configuration in Grails 3


Working on Grails 3 I realized that I no longer can specify external configuration using the standard grails.config.locations property in Config.groovy file.

Reason is obvious! There is no Config.groovy now in Grails 3. Instead we now use application.yml to configure the properties. However, you can't specify the external configuration using this file too!

What the hack?

Now Grails 3 uses Spring's property source concept. To enable external config file to work we need to do something extra now.

@CaptainOfFlyingDutchman
CaptainOfFlyingDutchman / grails_3_debugging.md
Created January 22, 2016 15:36
Debugging your Grails 3.0.x application

Every new version of Grails brings some enhancements, and challenges on developer side too. Starting Grails 2.3.x we used different approach to debug our application, and now we are again on same place with Grails 3.0.x.

As Grails is now using Spring Boot and Gradle, we have to hook into bootRun gradle task that gets added by Spring Boot Gradle plugin. You won't find this task anywhere in your build.gradle file but inside Gradle tool window of IntelliJ IDEA. To facilitate debugging again we just need to hook into this bootRun task as follows:

bootRun {
    addResources = false
    jvmArgs = ["-Xdebug", "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"]
}
@CaptainOfFlyingDutchman
CaptainOfFlyingDutchman / .vimrc
Last active October 4, 2022 22:12
Sample .vimrc to enable React and JSX inside vim with emmet and other things.
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@CaptainOfFlyingDutchman
CaptainOfFlyingDutchman / OpenWithSublimeText3.bat
Created October 11, 2016 17:34 — forked from roundand/OpenWithSublimeText3.bat
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@CaptainOfFlyingDutchman
CaptainOfFlyingDutchman / ConEmu Git Bash.md
Last active September 17, 2017 18:24 — forked from n3dst4/ConEmu Git Bash.md
My ConEmu / Cmder git bash task config
  1. Open Conemu

  2. Open Settings -> Tasks or go to new tab button -> Setup tasks.

  3. Click + to add a new task

  4. Enter the name as Git Bash or whatever you like

  5. Task parameters:

      /icon "C:\Program Files\Git\mingw64\share\git\git-for-windows.ico"
    
  6. Command:

@CaptainOfFlyingDutchman
CaptainOfFlyingDutchman / sublime-keymap.md
Last active October 15, 2016 09:13
Sublime Text 3 | Preferences and Key bindings
[
  { "keys": ["f2"], "command": "toggle_side_bar" },
  { "keys": ["f1"], "command": "focus_side_bar" },
  { "keys": ["f4"], "command": "reveal_in_side_bar"},
  { "keys": ["ctrl+b"], "command": "goto_definition" },
]
@CaptainOfFlyingDutchman
CaptainOfFlyingDutchman / script.md
Created October 18, 2016 07:41
Do the harlem shake script for any website

Copy paste following code in the browser console.

javascript:(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document
@CaptainOfFlyingDutchman
CaptainOfFlyingDutchman / Sublime Text Packages I use.md
Created January 24, 2017 10:34
Lists all the packages that I have installed on my computer.
{
	"bootstrapped": true,
	"in_process_packages":
	[
	],
	"installed_packages":
	[
		"Agila Theme",
 "AutoFileName",