Skip to content

Instantly share code, notes, and snippets.

View sroehrl's full-sized avatar

neoan sroehrl

View GitHub Profile
@sroehrl
sroehrl / CoursesSearched.vue
Created April 6, 2020 19:09
helping out on reddit
<template>
<section id="courses-searched">
<div class="course" v-for="(course, index) in courses.slice(0,10)" :key="index">
<button
@click="course.show=!course.show">
X
</button>
<div v-if="course.show" class="course">
<div
<?php
// assumes existence of 'config.php'
require_once 'config.php';
/**
* Class Database
*/
class Database
{
@sroehrl
sroehrl / index.js
Created March 11, 2020 14:16
Little cli tasks tool as outlined in https://youtu.be/d8P7NIqQelE
const inquirer = require('inquirer');
const fs = require('fs');
const jsonPath = __dirname + '/tasks.json';
let tasks = JSON.parse(fs.readFileSync(jsonPath, 'utf8'));
function run() {
inquirer.prompt([
{
name: 'action',
@sroehrl
sroehrl / protector.js
Created January 11, 2020 14:56
Handling customElements cross-browser
const _customElementsDefine = window.customElements.define;
window.customElements.define = (name, cl, conf) => {
if (!customElements.get(name)) {
_customElementsDefine.call(window.customElements, name, cl, conf);
}
};
@sroehrl
sroehrl / tabs.js
Last active September 29, 2021 01:53
Simple vanilla JavaScript tab-system ( for static pages or CSS only frameworks like bulma or tailwind)
const tabSystem = {
init(){
document.querySelectorAll('.tabs-menu').forEach(tabMenu => {
Array.from(tabMenu.children).forEach((child, ind) => {
child.addEventListener('click', () => {
tabSystem.toggle(child.dataset.target);
});
if(child.className.includes('is-active')){
tabSystem.toggle(child.dataset.target);
}
SELECT
lo.id,
"Envision" as academy,
competency.competency,
lo.name,
csfv.value,
co.id as co_id,
co.name as co_name
FROM learning_objective lo
@sroehrl
sroehrl / receiver.php
Last active December 7, 2019 14:20
PHP blua.blue webhook receiver to generate static pages
<?php
define('path', __DIR__);
// (composer require neoan3-apps/ops)
require_once path . '/vendor/autoload.php';
function logger($input)
{
file_put_contents(__DIR__ . '/log.json', json_encode($input));
}
@sroehrl
sroehrl / _post.vue
Created October 24, 2019 20:22
blua.blue in nuxt (poc)
// this file is in pages/blog/
<template>
<div>
<div class="container" v-if="display==='overview'">
<div v-for="post in result">
<a :href="'/blog/'+post.slug">{{post.name}}</a>
</div>
</div>
<div class="container" v-if="display==='post'">
<h1 class="title">{{result.name}}</h1>
@sroehrl
sroehrl / report.sql
Last active September 19, 2019 15:04
CO, Contact, Core LO
SELECT
co.id AS co_id,
co.name AS Content_Object,
contact.value AS Client_Contact,
lo.name AS core_lo
FROM content_object_customer_specific_field_value AS contact
JOIN content_object AS co ON contact.content_object_id = co.id
AND HEX(contact.customer_specific_field_id) LIKE "%0FF6E9CDC81411E99B6602313DCACE58%"
@sroehrl
sroehrl / report.sql
Created September 19, 2019 00:08
The impossible
SELECT
academy.name as academy,
GROUP_CONCAT(DISTINCT competency.name SEPARATOR ', ') as competency,
core_lo.name as lo,
co.name as co,
csfv.value as proficiency,
lo_non.name as non_core_lo,
other_co.name as other_cos
FROM learning_objective_group academy