Skip to content

Instantly share code, notes, and snippets.

<div id="alert">
<p>This is an alert! Just want to inform you about that.</p>
</div>
<script type="text/javascript">
$(function() {
$("#alert").dialog2({
title: "Alert",
autoOpen: false,
buttons: {
Close: {
<p>
<a href="#" id="show-server-notice-link">Show me some server content!</a>
</p>
<script type="text/javascript">
$(function() {
$("#show-server-notice-link").click(function(event) {
$('<div/>').dialog2({
title: "Server notice",
content: "./notice.html",
id: "server-notice"
<a href="#" rel="alert4" class="open-dialog2">decide on my favourite button color!</a>
<div id="alert4">
<h1>Decision</h1>
<p>Decide on an option</p>
<div class="actions">
<a class="btn info" href="#">Info</a>
<a class="btn success" href="#">Success</a>
<button class="danger">Danger</button>
<button class="dialog-close">Close</button>
<a class="open-dialog2" closeOnOverlayClick="false" showCloseHandle="false" rel="sample1-dialog">simple alert</a>
<!-- which is equivalent to the following javascript snippet -->
<script type="text/javascript">
$(function() {
$("#sample1-dialog").dialog2({
showCloseHandle: false,
removeOnClose: false,
autoOpen: false
});
<div id="sample1-dialog" style="display: none">
<h1>Simple alert</h1>
<p>
It is always beneficial to acknowledge alerts of any kind.
You can close this alert if you agree.
(Note: Normaly a dialog box is not that penetrating)
</p>
<div class="actions">
<button class="primary close-dialog">Understood</button>
<button class="danger" onclick="alert('You might reconsider your click behaviour!')">I don't care</button>
<a href="#" id="show-alert">alert</a>,
<a href="#" id="show-confirm">confirm</a>,
<a href="#" id="show-prompt">prompt</a>
<script type="text/javascript">
$("#show-alert").click(function(event) {
$.fn.dialog2.helpers.alert("This dialog is non intrusive", {
close: function() {
alert("This one is!");
}
});
@nikku
nikku / rm.js
Created May 30, 2013 09:24
Recursive directory delete written in NodeJS
var fs = require('fs');
var util = require('util');
// print process.argv
var dir = process.argv[2];
if (!dir) {
log('usage script DIR_TO_DELETE');
process.exit(1);
@nikku
nikku / glassfish4-localhost-domain.xml
Last active September 19, 2018 16:12
A stripped down domain.xml for Glassfish 4 application servers behind an Apache 2 / Nginx proxy.
<domain log-root="${com.sun.aas.instanceRoot}/logs" application-root="${com.sun.aas.instanceRoot}/applications" version="89">
<security-configurations>
<authentication-service default="true" name="adminAuth" use-password-credential="true">
<security-provider name="spcrealm" type="LoginModule" provider-name="adminSpc">
<login-module-config name="adminSpecialLM" control-flag="sufficient" module-class="com.sun.enterprise.admin.util.AdminLoginModule">
<property name="config" value="server-config"></property>
<property name="auth-realm" value="admin-realm"></property>
</login-module-config>
</security-provider>
<security-provider name="filerealm" type="LoginModule" provider-name="adminFile">
@nikku
nikku / brosome-git.md
Last active December 30, 2015 03:38
Git awesome hacker shortcuts

Pull

Pull changes into the local repository.

  • Pull upstream changes from <remote name>/<branch name> and perform a rebase on current branch instead of merging it (via). Useful to update+merge pull requests.

    git pull --rebase <remote name> <branch name>
    
@nikku
nikku / wincmd.md
Last active August 29, 2015 13:56
Windows command line hacks

Windows CMD hacks

This document contains a list of useful windows command line tools.

Open

From Explorer