This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void buildCN() | |
{ | |
cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" + filePath; | |
try { cn.Open(null, null, null, 0); } | |
catch (Exception e) { Console.WriteLine(e.ToString()); } | |
} | |
public static void closeCN(){ | |
try{ cn.Close(); } | |
catch (Exception e) { Console.WriteLine(e.ToString()); } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Const adOpenStatic = 3 | |
Const adLockOptimistic = 3 | |
Const adCmdText = &H1 | |
Set XConn = New ADODB.Connection | |
Set XRecSet = New ADODB.Recordset | |
XConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ | |
"Data Source=U:\User Admin Tools\User Tables.xlsm;" & _ | |
"Extended Properties=""Excel 8.0;HDR=Yes;"";" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onSubmit() { | |
var alrtMsg = null; | |
var kWords = g_form.getValue('short_description'); | |
var ga = new GlideAjax('CheckKnownIssues'); //Use the name of the Script Include | |
ga.addParam('sysparm_name', 'findKeywords'); //findKeywords is a function in the include | |
ga.addParam('sysparm_keyWrds', kWords ); //kWords is a variable in the include (var kywrds = this.getParameter('sysparm_keyWrds');) | |
ga.getXMLWait(); //Wait on the script to complete | |
alrtMsg = ga.getAnswer(); //Get the returned value from the Script Include | |
if (alrtMsg != null) { | |
return confirm(alrtMsg + "\n\n" + "Please click \"OK\" if you would still like to submit this reqest."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Opens dialog window container - Table Form View | |
function newGDF(tableName, sysID, disVal){ | |
var dialog = new GlideDialogForm('View User', tableName); | |
dialog.setTitle(disVal); | |
dialog.setSysID(sysID); | |
dialog.addParm('sysparm_view', 'sys_popup'); | |
dialog.addParm('sysparm_form_only', 'true'); | |
dialog.render(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(arr){ | |
var newArr = []; | |
angular.forEach(arr, function(value, key) { | |
var exists = false; | |
angular.forEach(newArr, function(val2, key) { | |
if(angular.equals(value.id, val2.id)){ exists = true }; | |
}); | |
if(exists == false && value.id != "") { newArr.push(value); } | |
}); | |
return newArr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.sortedArr = function(prop, propVal, masterArr){ | |
var newArr = []; | |
angular.forEach(masterArr, function(value, key) { | |
if(angular.equals(value[prop], propVal)){ newArr.push(value); } | |
}); | |
return newArr; | |
}; | |
var objArr = [ | |
{ "first_name" : "George", "last_name" : "Washington" }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//property = first_name | |
function compare(a,b) { | |
if (a.first_name < b.first_name) | |
return -1; | |
if (a.first_name > b.first_name) | |
return 1; | |
return 0; | |
} | |
//object array = data.records | |
var sorted = data.records.sort(compare); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fetchWeather(zip) { | |
openweather.getWeather(zip).then( | |
function(data){ | |
$scope.weatherData = data.data.query.results.channel; | |
$scope.weatherDays = $scope.weatherData.item.forecast; | |
var desc = $scope.weatherData.item.description.split("\"/><br", 2); | |
$scope.weatherPic = desc[0].replace("\n<img src=\"", ""); | |
}, | |
function(data){ return; } | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"> | |
<g:requires name="angular-min.1.3.16.jsdbx" /> | |
<link href="3ca86ab937380a006215d68543990ef6.cssdbx" rel="stylesheet" type="text/css"></link> | |
<g2:evaluate var="jvar_stamp"> | |
var gr = new GlideRecord('sys_ui_script'); | |
gr.get("13a5ea4d37300a006215d68543990e41"); | |
gr.getValue('sys_updated_on'); | |
</g2:evaluate> | |
<g:requires name="cs-dashboard-script.jsdbx" params="cache=$[jvar_stamp]" /> |