Skip to content

Instantly share code, notes, and snippets.

View bmbrands's full-sized avatar

Bas Brands bmbrands

View GitHub Profile
YUI().use("node", function(Y) {
var btn_Click = function(e) {
Y.one('.btn-navbar').addClass('active');
togglemenu = Y.one('.nav-collapse');
if (togglemenu.hasClass('active')) {
togglemenu.setStyle('height','0px');
togglemenu.removeClass('active');
} else {
togglemenu.addClass('active');
togglemenu.setStyle('height','auto');
YUI.add('moodle-block_codex_about-toggler', function(Y) {
// Your module code goes here.
// Define a name space to call
M.block_codex_about = M.block_codex_about || {};
M.block_codex_about.toggler = {
init: function() {
var toggleShow = function (e,param) {
console.log('test');
console.log(param);
@bmbrands
bmbrands / gist:5976154
Created July 11, 2013 14:55
moodle file stuff
function get_content() {
global $DB,$USER,$OUTPUT,$CFG;
$courseid = $this->page->course->id;
//Ensure only teacher can use this block
$coursecontext = context_course::instance($courseid);
if(has_capability('moodle/course:manage', $coursecontext)){
$this->content = new stdClass;
YUI.add('moodle-theme_surf-yuimodal', function(Y) {
var yuimodal = 'yuimodal panel';
var panel = new Y.Panel({
srcNode: '#panelContent',
width : 600,
xy : [300, 0],
zIndex : 6,
modal : true,
/* @import
url(/theme/styles.php/_s/bootstrap/1396012647/all/chunk1);
@import
url(/theme/styles.php/_s/bootstrap/1396012647/all/chunk2);
} */
.yui-skin-sam .yui-layout.path-mod-chat-gui_ajax #chat-messages .chat-event.course-theme
{
text-align: center;
.que.calculated
.answer {
padding: 0.3em;
width: auto;
display: inline
}
.que.calculated .answer input[type="text"] {
width: 30%
}
0
.1
);box-shadow
:inset
0
1
px
0

Keybase proof

I hereby claim:

  • I am bmbrands on github.
  • I am basbrands (https://keybase.io/basbrands) on keybase.
  • I have a public key whose fingerprint is F82F BE9E 8D6C C828 68DD E138 D4FE F60B 2198 4A7E

To claim this, I am signing this object:

@bmbrands
bmbrands / gist:ac5c81a71a9cc808b346
Last active August 29, 2015 14:15
Alternative validation
function validation($data, $files) {
$errors = parent::validation($data, $files);
// Check if any item quantities were selected.
// Retrieve order items and amounts.
// First assume the user has not selected anything.
$allempty = true;
// Loop through all of the form fields.
foreach ($data as $field => $value) {
.font-face(@family, @name, @weight: 300) {
@font-face{
font-family: @family;
src:url('[[font:theme|@{name}.eot]]');
src:url('[[font:theme|@{name}.eot]]?#iefix') format('embedded-opentype'),
url('[[font:theme|@{name}.woff]]') format('woff'),
url('[[font:theme|@{name}.ttf]]') format('truetype'),
url('[[font:theme|@{name}.svg]]') format('svg');
font-weight: @weight;
}