Skip to content

Instantly share code, notes, and snippets.

@Synvox
Synvox / spectre.css
Created June 2, 2016 18:59
Custom Version of Spectre
/*! normalize.css v4.0.0 | MIT License | github.com/necolas/normalize.css */a,abbr[title]{text-decoration:underline}progress,sub,sup{vertical-align:baseline}button,hr,input,select{overflow:visible}html,legend{box-sizing:border-box}pre,textarea{overflow:auto}blockquote p:last-child,pre code{margin-bottom:0}.btn-group .btn:focus,.btn-group .btn:hover,.input-group .form-input:focus,.input-group .input-group-addon:focus,.input-group .input-group-btn:focus{z-index:99}html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent;color:#0c5594}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline dotted}.breadcrumb .breadcrumb-item a,.btn,.chip-sm,.menu .menu-item,.menu .menu-item a,.navbar .navbar-brand,.tab .
@Synvox
Synvox / powergrid.js
Last active June 2, 2016 19:22
16x16 grid system for beautiful web applications
//! Power Grid - Ryan Allred 2016 - MIT License
{
'use strict';
const cellSize = 20
const gridCells = 16
const gridSize = cellSize * gridCells
const normalGrid = (width, height)=>{
return `[data-grid] {position: absolute !important}`;
@Synvox
Synvox / console.js
Last active March 12, 2016 20:14
Brightspace discussion board notes
// get d2l_referrer (required for making posts)
var list = window.top.D2L.OR.__g1
for(var i in list)
if (list[i].indexOf('d2l_referrer') !== -1)
return JSON.parse(list[i]).P[1]
// Unofficial API (This one doesn't give 403s to students)
$.post('https://byui.brightspace.com/d2l/le/(ORG_UNIT)/discussions/posts/(TOPIC)/FinishReply',{
<div class="phrases">
<div class="phrase">First</div>
<div class="phrase">Second</div>
<div class="phrase">Third</div>
<div class="phrase">Fourth</div>
</div>
<script>
;(function(){
@Synvox
Synvox / QuizResults.js
Last active February 19, 2016 19:41
Quiz Results
$(function() {
var getAttempts = function(url, cb){
$.get(url, function(result) {
var dom = $(result),
text = dom.find('label').eq(9).text().split(',')
attempts = text[0].split(' - ')[1],
completed = text[1].split(' - ')[1],
remaining = parseInt(attempts) - parseInt(completed.split(' ')[0])
cb(remaining, completed)
@Synvox
Synvox / auditor.js
Last active February 10, 2016 17:24
Course Auditing tool via JavaScript console
/**
* Course Auditing tool via JavaScript console
* Ryan Allred
*/
var Auditor = {}
;(function(Auditor){
'use strict'
<?php
// these will never show because they are never echo'ed in this file.
$error_message = "";
if (empty($product_description)){
$error_message = 'Field cannot be blank.';
} else if (!is_numeric($list_price)){
$error_message = 'List price must be a valid number.';
} else if (!is_numeric($discount_percent)){
$error_message = 'Discount must be a valid number.';
} else {
@Synvox
Synvox / background.js
Created January 21, 2016 05:20
An I-Learn webscraper
var scriptElement = document.body.appendChild(document.createElement('script'))
scriptElement.type='text/javascript'
scriptElement.src='jquery-2.2.0.js'
var errors = []
var items = []
function Item(that) {
for(var i in that)
this[i] = that[i]
topics.txt
directory/
var links = document.querySelectorAll('.uiIconText.addButton')
for(var i in links) links[i].click()