Skip to content

Instantly share code, notes, and snippets.

View weeksdev's full-sized avatar
🏠
Working from home

Andrew Weeks weeksdev

🏠
Working from home
View GitHub Profile
@weeksdev
weeksdev / getFieldValuesFromForm.js
Last active January 1, 2016 05:49
ExtJS4: getFieldValues from Form
getFieldValues: function (itemIds, form) {
var values = [];
var delimitedValues = '';
var i = 0;
Ext.each(itemIds, function (itemId) {
values[i] = form.down(itemId).getValue();
delimitedValues = delimitedValues + values[i] + '|';
i++;
});
var returnObj = new Object();
@weeksdev
weeksdev / regExFindConsoleLogsNotCommented
Created December 26, 2013 21:57
regExFindConsoleLogsNotCommented
(?<!//)(?>console.log)(.*)(?=;)
@weeksdev
weeksdev / regExTextInString
Created December 27, 2013 16:50
regExTextInString
(?<=')(.*)Item(.*)(?<=,)
@weeksdev
weeksdev / Controller.js
Last active January 1, 2016 13:09
ExtJS MVC Snippets
Ext.define('App.controller.exampleController', {
extend: 'Ext.app.Controller',
init: function () {
this.control({
'#someButton': {
click: this.buttonAction
}
});
},
buttonAction: function (btn) {
@weeksdev
weeksdev / sqlStoredProcParams.sql
Last active January 1, 2016 13:39
SQL Stored Proc Get Parameter Names
select parameter_name,data_type from information_schema.parameters
where specific_name='storedProcName'
@weeksdev
weeksdev / JsonP.request.js
Created January 2, 2014 15:35
ExtJS JsonP Request
Ext.data.JsonP.request({
'url': 'url',
params: {
'param1': 'value'
},
success: function (result, request) {
//success
}
});
@weeksdev
weeksdev / Ajax.request.js
Last active January 2, 2016 00:59
ExtJS Ajax Request
Ext.Ajax.request({
url: 'page.php',
params: {
id: 1
},
success: function(response){
var text = response.responseText;
// process server response here
// var jsonData = Ext.JSON.decode(response.responseText);
// console.log(jsonData);
@weeksdev
weeksdev / ssn.regex
Last active January 2, 2016 10:38
RegEx: SSN
999-99-9999(SSN)
^(?!(000|666|9))\d{3}-(?!00)\d{2}-(?!0000)\d{4}$
99-9999999(Tax-Id)
@"^(?!(000|666|9))\d{2}-(?!00)\d{7}"
@weeksdev
weeksdev / itemId.regex
Created January 7, 2014 21:09
RegEx: itemId
(?<=itemId:\s?').+?(?=')
@weeksdev
weeksdev / gist:8319804
Created January 8, 2014 16:39
MSSQL: Get Stored Procs and Stored Proc Code From DB
select OBJECT_SCHEMA_NAME ( a.object_id) + '.' + a.name
,OBJECT_SCHEMA_NAME ( a.object_id) as [schema]
,OBJECT_DEFINITION(a.object_id) as def
from
sys.all_objects a
where a.type_desc = 'SQL_STORED_PROCEDURE'
and a.name not like 'sp_%'
and a.name not like 'xp_%'