Skip to content

Instantly share code, notes, and snippets.

View biniama's full-sized avatar

Biniam biniama

View GitHub Profile
@biniama
biniama / MySql-StoredProcedure-Logger.sql
Created November 19, 2015 14:26
MySql StoredProcedure Logger
DELIMITER $$
DROP PROCEDURE IF EXISTS setupLogging $$
CREATE PROCEDURE setupLogging()
BEGIN
CREATE TABLE IF NOT EXISTS sp_logger(ts timestamp DEFAULT current_timestamp, thingID bigint, msg varchar(512)) ENGINE = MyISAM;
END $$
CALL setupLogging() $$
DROP PROCEDURE IF EXISTS setupTmpLog $$
@biniama
biniama / getListOfCustomersForSearchCustomer
Last active August 29, 2015 14:22
Example of Using Hibernate Create Criteria for a complex query in Grails
List<Account> getListOfCustomersForSearchCustomer(String firstName, String lastName, String phoneNumber, String accountNumber)
{
return Account.createCriteria().list {
or {
eq("accountNumber", accountNumber)
user {
or {
// JavaScript/JQuery
<script>
$(document).ready(function(){
<!-- Cancel Process -->
$('.showCancelProcessDialog').click(function(){
selectedProcessId = $(this).attr('id');
$( "#cancelProcessDialog" ).dialog({ width: 350 });
<script>
$(document).ready(function(){
// Updating Profile
$('#editProfile').click(function(){
// show the update button div
$('#updateProfileDiv').show();
// hide the edit button div
$('#editProfileDiv').hide();
});