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
require_once('../config.php'); | |
require_once($CFG->libdir.'/gdlib.php'); | |
require_once($CFG->dirroot.'/user/edit_form.php'); | |
require_once($CFG->dirroot.'/user/editlib.php'); | |
require_once($CFG->dirroot.'/user/profile/lib.php'); | |
require_once($CFG->dirroot.'/user/lib.php'); | |
$referer = get_local_referer(false); | |
if($referer == $CFG->httpswwwroot . '/login/index.php'){ | |
redirect(new moodle_url($CFG->httpswwwroot . '/')); |
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 dotheenrols(){ | |
global $OUTPUT, $USER, $DB; | |
$all_users = $DB->get_records_sql('SELECT * FROM mdl_user WHERE deleted = 0'); | |
foreach ($all_users as $r_user){ | |
//set all user table variables | |
if($r_user->id){$user_id = $r_user->id;} | |
if($user_id >27){ | |
if ($record = $DB->get_record('badge_issued', array('badgeid' => 3, 'userid' => $user_id))) { | |
//they have the badge |
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
//this should be added after $SESSION->wantsurl = null; (there are roughly 4 occurances, consider each individually) | |
if($student_course_arry = enrol_get_users_courses($USER->id, true, Null, 'visible DESC,sortorder DESC')) | |
{ | |
foreach($student_course_arry as $value) | |
{ | |
$SESSION->wantsurl = $CFG->httpswwwroot . '/course/view.php?id=' . $value->id; | |
} |
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
$all_comp_courses = $DB->get_records_sql('SELECT * FROM {course_completion_crit_compl} WHERE userid = ?', array($USER->id)); | |
$root = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/'; | |
foreach ($all_comp_courses as $comp_array) { | |
//$this->content->text .= "Course: ".$comp_array -> course; | |
$this->content->text .= '<script> | |
var coursetile = $(\'a[href$="'.$root.'course/view.php?id='.$comp_array -> course.'"]\').siblings(".panel-body").find(".cimbox").addClass("course_complete"); | |
</script>'; | |
// $this->content->items[] .= "<script>$(".coursebox-content").css("color", "red");</script>" | |
} |
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
$("#my-awesome-dropzone").dropzone({ | |
url: "upload-files.php", | |
maxFilesize: 2, | |
acceptedFiles: ".txt", | |
sending: function (file, xhr, formData) { | |
var sider = $("#side").val(); | |
var deckName = $("#deckname").val(); | |
formData.append("filename", deckName); | |
formData.append("side", sider); | |
}, |
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() { | |
var data = String(window.location); | |
var isebay = data.indexOf("ebay"); | |
var isquery = data.indexOf("?"); | |
var ipg = data.indexOf("&_ipg=200"); | |
if(isebay != -1 & isquery != -1 & ipg != -1){ | |
$('.prRange').parents('.lvresult').hide(); | |
console.log('All those annoying variable listings have been removed.'); |
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
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'jquery/jquery.min.js' | |
}); | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
}); |
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
$('.prRange').parents('.lvresult').hide(); |
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
{ | |
"name": "Ebay Variations Go Away!", | |
"version": "0.1", | |
"manifest_version": 2, | |
"description": "This extension is designed to completely rid ebay search results of those annoying variations listings which are commonly abused and destroy your ability to find the cheapest item.", | |
"homepage_url": "http://oliverstearn.com/projects?project=ebay_extension", | |
"permissions": [ | |
"https://*/*", | |
"http://*/*", | |
"tabs" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Advent of Code Day 1</title> | |
<script> | |
var input = "L2, L3, L3, L4, R1, R2, L3, R3, R3, L1, L3, R2, R3, L3, R4, R3, R3, L1, L4, R4, L2, R5, R1, L5, R1, R3, L5, R2, L2, R2, R1, L1, L3, L3, R4, R5, R4, L1, L189, L2, R2, L5, R5, R45, L3, R4, R77, L1, R1, R194, R2, L5, L3, L2, L1, R5, L3, L3, L5, L5, L5, R2, L1, L2, L3, R2, R5, R4, L2, R3, R5, L2, L2, R3, L3, L2, L1, L3, R5, R4, R3, R2, L1, R2, L5, R4, L5, L4, R4, L2, R5, L3, L2, R4, L1, L2, R2, R3, L2, L5, R1, R1, R3, R4, R1, R2, R4, R5, L3, L5, L3, L3, R5, R4, R1, L3, R1, L3, R3, R3, R3, L1, R3, R4, L5, L3, L1, L5, L4, R4, R1, L4, R3, R3, R5, R4, R3, R3, L1, L2, R1, L4, L4, L3, L4, L3, L5, R2, R4, L2"; | |
var orientation = "N"; | |
var coordinates= new Array(); |