Skip to content

Instantly share code, notes, and snippets.

Select DISTINCT r.timestamp AS timestamp_UTC, DATEADD(hour,-5,r.timestamp) AS timestamp_EST, p.unique_name AS username, u.name ,
r.remote_ip as IP, r.user_agent, r.URL
From requests r
LEFT JOIN pseudonym_dim p ON r.user_id = p.user_id
LEFT JOIN user_dim u ON r.user_id = u.id
Where url like '%courses/52212/quizzes/255725/edit%';
Sub format_pageviews_csv()
With ActiveWorkbook.ActiveSheet.Range("A1:B1, J1, L1:M1, P1:Q1, S1").EntireColumn
.Delete
End With
ActiveWorkbook.ActiveSheet.Range("B1:K1").EntireColumn.AutoFit
ActiveWorkbook.ActiveSheet.Range("A1").EntireColumn.ColumnWidth = 140
With ActiveWorkbook.ActiveSheet.Range("A1:k1")
componentDidUpdate(prevProps, prevState) {
Object.entries(this.props).forEach(([key, val]) =>
prevProps[key] !== val && console.log(`Prop '${key}' changed`)
);
Object.entries(this.state).forEach(([key, val]) =>
prevState[key] !== val && console.log(`State '${key}' changed`)
);
}
@tidusx18
tidusx18 / RestoreCanvasItems.js
Created December 12, 2018 21:22
The code can be pasted into the console of a browser window with an active Canvas session with the appropriate course ID and assignment ID.
let csrf = Cookies.get('_csrf_token')
let courseID = ''
let assignmentID = ''
fetch('https://fiu.instructure.com/courses/${courseID}/undelete/assignment_${assignmentID}', {
method: 'POST',
headers: {
'X-CSRF-Token': csrf
},
})
@tidusx18
tidusx18 / ReplaceDatesCreatorPro.js
Created December 10, 2018 19:33
User needs to click into syllabus calendar to enable targeted selector.
function replaceCreatorProDates() {
let regex = />Module available from.+</igm;
// let regex = />Module available from.+<\/p>|<p>.+Module available from.+<\/p>/igm;
let calendarDates = document.querySelectorAll('.generic_table.cke_show_border tbody tr > td:first-child');
let newDates = [
'>Module available from Monday, Jan 7 at 5:00 AM - Tuesday, Jan 15 at 11:55 PM<',
'>Module available from Monday, Jan 14 at 5:00 AM - Tuesday, Jan 22 at 11:55 PM<',
'>Module available from Monday, Jan 21 at 5:00 AM - Tuesday, Jan 29 at 11:55 PM<',
'>Module available from Monday, Jan 28 at 5:00 AM - Tuesday, Feb Feb 5 at 11:55 PM<',
@tidusx18
tidusx18 / Select.js
Last active September 28, 2018 14:52
$$('.ChoiceStructure li:nth-child(1) label').forEach( item => item.click())
$$('.ChoiceStructure tr td:nth-child(4) span label').forEach( item => item.click())
Sub ListToText()
'
' ListToText Macro
'
'
ActiveDocument.ConvertNumbersToText
End Sub
@tidusx18
tidusx18 / partitionArray.js
Created March 27, 2018 17:35
Split up an array into groups of n values.
function partitionArray(arr, n) {
const res = [];
for (let i = 0; i < Math.floor(arr.length / n); i++) {
res.push(arr.slice(i * n, (i + 1) * n));
}