Skip to content

Instantly share code, notes, and snippets.

View andrewhosgood's full-sized avatar

Andrew Hosgood andrewhosgood

  • Sponge UK
  • Plymouth, UK
View GitHub Profile
@andrewhosgood
andrewhosgood / zzzzz.sql
Created December 13, 2017 09:55
Sleep attack param
(select*from(select(sleep(2)))a)
let WORDCOUNT = 0,
CHARACTERCOUNT = 0,
CHARACTERCOUNTWITHSPACES = 0;
const ADAPT = requirejs( 'coreJS/adapt' ),
COURSE = ADAPT.course,
CONTENTOBJECTS = ADAPT.contentObjects._byId,
BLOCKS = ADAPT.blocks._byId,
ARTICLES = ADAPT.articles._byId,
COMPONENTS = ADAPT.components._byId,
for( let co in ( requirejs( 'coreJS/adapt' ) ).contentObjects._byAdaptID ) {
console.log( co + ': ' + ( ( requirejs( 'coreJS/adapt' ) ).contentObjects._byAdaptID[co][0].attributes._isComplete ? 'COMPLETE ' : 'INCOMPLETE' ) + ', ' + ( ( requirejs( 'coreJS/adapt' ) ).contentObjects._byAdaptID[co][0].attributes._isOptional ? 'OPTIONAL ' : 'NOT OPTIONAL' ) );
}
for( let a in ( requirejs( 'coreJS/adapt' ) ).articles._byAdaptID ) {
console.log( a + ': ' + ( ( requirejs( 'coreJS/adapt' ) ).articles._byAdaptID[a][0].attributes._isComplete ? 'COMPLETE ' : 'INCOMPLETE' ) + ', ' + ( ( requirejs( 'coreJS/adapt' ) ).articles._byAdaptID[a][0].attributes._isOptional ? 'OPTIONAL ' : 'NOT OPTIONAL' ) );
}
for( let b in ( requirejs( 'coreJS/adapt' ) ).blocks._byAdaptID ) {
console.log( b + ': ' + ( ( requirejs( 'coreJS/adapt' ) ).blocks._byAdaptID[b][0].attributes._isComplete ? 'COMPLETE ' : 'INCOMPLETE' ) + ', ' + ( ( requirejs( 'coreJS/adapt' ) ).blocks._byAdaptID[b][0].attributes._isOptional ? 'OPTIONAL ' : 'NOT
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@andrewhosgood
andrewhosgood / git-commands.sh
Last active December 1, 2017 11:36
Useful Git commands
Pull all submodules, even if not initialised
$ git submodule update --init --recursive
Add a course as a submodule
$ git submodule add [repo URL] src/courses/[course name]
View statuses of all submodules
$ git submodule status
Pull all course submodules (assuming default of master branch)