Skip to content

Instantly share code, notes, and snippets.

@NKjoep
NKjoep / postgres-setup.md
Last active August 29, 2015 14:16
PostreSQL Setup

pg_hba.conf:

  host	all	all	0.0.0.0/0	trust

postgres.conf:

  listen="*"
@NKjoep
NKjoep / backup-japs.sh
Created March 18, 2011 13:10
This script will backup both your PostgreSQL databases of your jAPS Entando application.
#!/bin/bash
## Title: backup-japs.sh
#
## Description: This script will backup both your PostgreSQL databases of your jAPS Entando application.
## Will write in the current directoy two files: 2010-03-18-1406_PortalExamplePort.backup, 2010-03-18-1406_PortalExampleServ.backup
#
## Usage: backup-japs.sh host port username password project
## Example: backup-japs.sh localhost 5432 agile mypassword PortalExample
#
#
@NKjoep
NKjoep / fast-renamer.sh
Created March 18, 2011 15:09
This simple bash script will rename all the files in the current directory: all lowercase, spaces to _ , minus - to _
#!/bin/bash
rename 'y/A-Z/a-z/' *
rename 'y/ /_/' *
rename 'y/-/_/' *
@NKjoep
NKjoep / google-chrome-nocache.sh
Created March 22, 2011 13:48
Launch Google Chrome with cache disable
#!/bin/bash
## Description: Launch Google Chrome with cache disable
## Author: Andrea D. <nkjoep@gmail.com>
#
## Remember to change the path :)
/usr/bin/google-chrome %U --disk-cache-size=1 --media-cache-size=1
@NKjoep
NKjoep / current_jsp_path_filename.jsp
Created March 25, 2011 12:04
This will print out the full path of the executed JSP
This JSP is placed:
<%=getServletConfig().getServletContext().getRealPath(request.getServletPath())%>
@NKjoep
NKjoep / console.log.reg
Created May 6, 2011 10:06
Fast RegExp which find and replace all console.log( occurences in your code and comment them out.
//find this
(^.*[^//])console.log
//replace with
$1//console.log
@NKjoep
NKjoep / entando-headinfo-jsp-fragment.jsp
Created September 15, 2011 14:01
Entando Pagemodel Headinfo
<%@ taglib prefix="wp" uri="aps-core.tld" %>
<%-- css --%>
<wp:outputHeadInfo type="CSS">
<link rel="stylesheet" type="text/css" href="<wp:cssURL /><wp:printHeadInfo />" />
</wp:outputHeadInfo>
<%-- css for ie7 --%>
<wp:outputHeadInfo type="CSS_IE7">
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="<wp:cssURL /><wp:printHeadInfo />" />
@NKjoep
NKjoep / adminadmin-scriptlet.js
Created March 7, 2012 14:12
browser scriptlet for quick adminadminamdin
javascript:(function(){var%20inputs%20=%20document.getElementsByTagName("input");%20for%20(var%20i%20=%200;i<inputs.length;i++)%20{%20var%20c%20=%20inputs[i];%20if%20(c.name=="username")%20c.value%20=%20"admin";%20if%20(c.name=="password")%20c.value%20=%20"adminadmin";%20}%20})();
@NKjoep
NKjoep / Entando-wp18n.sublime-snippet
Created November 8, 2012 09:41
Sublime Text 2 Snippets Collection
<snippet>
<content><![CDATA[
-- DELETE FROM localstrings where keycode = '${1:keycode}';
INSERT INTO localstrings(keycode, langcode, stringvalue) VALUES ('${1:keycode}','en','${2:en_value}');
INSERT INTO localstrings(keycode, langcode, stringvalue) VALUES ('${1:keycode}','it','${3:it_value}');
-- <wp:i18n key="${1:keycode}" escapeXml="true" />
${4}
]]></content>
</snippet>
@NKjoep
NKjoep / angular-list-models.html
Created November 13, 2015 14:16
angular list models
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Input Sample</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.css">
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.1/angular.js"></script>