Skip to content

Instantly share code, notes, and snippets.

View thecfguy's full-sized avatar

Pritesh thecfguy

View GitHub Profile
@thecfguy
thecfguy / gist:6193183
Last active December 20, 2015 20:49 — forked from anonymous/gist:4282657
<cfscript>
x = createobject("webservice","http://www.webservicex.net/genericbarcode.asmx?WSDL",{refreshWSDL="yes",wsdl2javaArgs="-a -O 2000"});
argCollection.BarCodeParam = structNew();
argCollection.BarCodeParam.Height = 100;
argCollection.BarCodeParam.Width = 200;
argCollection.BarCodeParam.Angle = 50;
argCollection.BarCodeParam.Ratio = 1;
argCollection.BarCodeParam.Module = 1;
argCollection.BarCodeParam.Left = 10;
argCollection.BarCodeParam.Top = 10;
insert into <table name>
select <field list> from <table name from copy data>
insert into <table name> select <field list> from <table name from copy data>
insert into table2
select * from table1
insert into table2 (no,name,city)
select no,name,city from table1
INSERT INTO `muracms`.`tcontentcomments`
(commentId,contentId,comments,NAME,email,url,entered,isApproved,siteId)
SELECT
MC.id AS commentId,
MUT.contentId AS contentId,
MC.content AS comments,
MC.creator_name AS NAME,
MC.creator_email AS email,
MC.creator_url AS url,
MC.created_on AS entered,
@thecfguy
thecfguy / listscheduletask.cfm
Created August 18, 2013 05:18
List out all scheduled task in ColdFusion
<cfscript>
alltask=ArrayNew(1);
taskService=createobject('java','coldfusion.server.ServiceFactory').getCronService();
alltask=taskservice.listall();
</cfscript>
@thecfguy
thecfguy / submitform.cfm
Last active September 13, 2018 21:05
Create coldfusion window and submit form to display response in cfwindow.
<cfajaximport tags="cfwindow">
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/ext-all.js"></script>
<script>
function submitMe(){
var frm = window.document.frmTest;
ColdFusion.Window.create("Windowresponse","Response Window","",{x:100,y:100,height:200,width:400,modal:true,closable:true,draggable:true,resizable:true,center:true,initshow:true});
objWin = ColdFusion.Window.getWindowObject("Windowresponse");
var objupdate = objWin.getUpdater();
objupdate.update({url:frm.action,params:Ext.lib.Ajax.serializeForm("frmTest"), method:"POST",scripts:true});
@thecfguy
thecfguy / submitajax1.html
Created August 18, 2013 05:45
Method 1: Load html content with jQuery.ajax
<html>
<head>
<script src="/js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script>
function loadMe(){
$.ajax({
url:"scribble2.cfm?",
success:function(res){
$("#div1").html(res);
}
@thecfguy
thecfguy / jqueryajax.html
Created August 18, 2013 05:51
Method2: Call jquery.ajax and display response in variable div
<html>
<head>
<script src="/js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script>
function loadMe(){
$.ajax({
url:"scribble2.cfm?",
success:function(res){
showMessage(res,"div1");
}
@thecfguy
thecfguy / jqueryajax.html
Created August 18, 2013 05:54
Wrong way to call ajax within loop and using index in success method.
<html>
<head>
<script src="/js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script>
function loadMe(){
for(var i=1;i<=3;i++){
$.ajax({
url:"scribble2.cfm?",
success:function(res){
showMessage(res,i); // Call another function with additional parameter