Skip to content

Instantly share code, notes, and snippets.

@mollwe
mollwe / jquery.ajaxSubmit.js
Created November 24, 2011 10:30
Gets all input values within form and submits form with ajax.
/*!
* jquery.ajaxSubmit.js - v 0.9.3 (2011-11-29)
* Copyright (C) 2011 by Adam Ydenius ([email protected]) | http://mollwe.se
* Dual licensed under MIT and GPL.
*//*
* Gets all input (with name attribute) values within form and submits form with ajax.
* First argument, options, is object with:
* Properties:
* - url: override form action.
* - method: override form method.
@mollwe
mollwe / restore_database_example.sql
Last active June 16, 2017 08:16
Drops all connections to a database. Returns number of dropped connections.
use [master]
go
exec sp_dropallconnections N'dbname'
RESTORE DATABASE [dbname] FROM DISK = N'C:\dbname.bak' WITH FILE = 1, NOUNLOAD, STATS = 10
GO
@mollwe
mollwe / jquery.fieldselection.js
Created November 7, 2012 10:41
Enables placeholder for browsers without placeholder support
/*!
* jQuery plugin: fieldSelection - v0.1.0 - last change: 2006-12-16
* (c) 2006 Alex Brem <[email protected]> - http://blog.0xab.cd
*
* Modified 2012-11-07 by Adam Ydenius <[email protected]> http://mollwe.se
*/
/*
* Fixed some issues and proxying calls to original select if no parameters or callback.
* Keeping original as _select
*/
@mollwe
mollwe / jquery.ui.checkbox.js
Created July 10, 2013 11:47
Replaces checkboxes with a stylable jQuery UI widget.
/*!
* jquery.ui.checkbox.js - v 0.1 (2013-07-10)
* Copyright (C) 2013 by Adam Ydenius ([email protected]) | http://mollwe.se
* Dual licensed under MIT and GPL.
*/
/*
* Replaces checkboxes with a stylable jQuery UI widget.
*
* Inputs that has been enabled with this plugin has class "ui-checkbox-target".
*
@mollwe
mollwe / jquery.ui.combobox.css
Last active December 19, 2015 13:59
Replaces select (dropdowns) with a stylable jQuery UI widget that uses autocomplete.
.ui-combobox {
position: relative;
display: inline-block;
}
.ui-combobox-toggle {
width:1.5em;
right:-1px;
position: absolute !important;
top: 0;
bottom: 0;

Keybase proof

I hereby claim:

  • I am mollwe on github.
  • I am mollwe (https://keybase.io/mollwe) on keybase.
  • I have a public key ASCjkvKsWvhxO43xJd1zWNCku0te9x80C7QOri6UETl7qwo

To claim this, I am signing this object: