Skip to content

Instantly share code, notes, and snippets.

Derry Livenski hyperking

Block or report user

Report or block hyperking

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hyperking
hyperking / Google form processor
Last active Mar 17, 2018
Converts google form into JSON form response object
View Google form processor
var db = {}
var gf = _docs_flag_initialData['docs-seu'].replace('/edit','/formResponse');
var labels = [...document.querySelectorAll('.freebirdFormviewerViewItemsItemItem')];
var form = labels.forEach(function(elb,i){
//find labelname
var labelname = elb.querySelector('.freebirdFormviewerViewItemsItemItemTitle');
labelname = labelname.textContent;
db[labelname] = {};
@hyperking
hyperking / jinja_test.py
Last active Sep 9, 2017
Jinja Custom extension for moving block content into the footer
View jinja_test.py
from flask import Flask,render_template, render_template_string
from pprint import pprint
'''HTML JINJA TEMPLATE'''
# create a new test.html file with the jinjaTemplateString below to view the issue.
jinjaTemplateString = '''
<html> <head></head> <body> <h1>Test template</h1>
{% push 'js' %} ABC {% endpush %}
{% push 'js' %} XYZ {% endpush %}
View Custom Google Form Mapping
var inputs = {};
var poststr = [];
$('input[type="hidden"]').each(function(){
var entryKey = $(this).attr('name');
var entryValue = $(this).parent().find('input[type="text"],textarea').first().val();
if(entryKey.indexOf('entry.') == false){
console.log(entryKey);
inputs[entryKey] = entryValue;
poststr.push(encodeURIComponent(entryKey) + "=" + encodeURIComponent(entryValue));
@hyperking
hyperking / CRM designation parser
Last active Nov 9, 2015
How to structure BBCRM api designations response
View CRM designation parser
CRMresponse = [{
"Values": ["Arboretum Development Fund", "Arboretum", "University of Hyper\\Ontario Agricultural College\\Arboretum", "7b5ced38-53f1-412d-8a2a-98b947f086db", "", "Arboretum Development Fund", "7b5ced38-53f1-412d-8a2a-98b947f086db"]
}, {
"Values": ["Dean's Innovation Fund", "College of Arts", "University of Hyper\\College of Arts", "1ea85925-c4a9-4c3e-81f5-228b21ab1ec8", "Focuses on meeting the overall needs of the College of Arts.", "College of Arts Dean's Innovation Fund", "1ea85925-c4a9-4c3e-81f5-228b21ab1ec8"]
}, {
"Values": ["College of Arts Student Assistance", "College of Arts", "University of Hyper\\College of Arts", "bc17fa75-16c6-4c6a-876c-ef0ba284ec6f", "", "College of Arts Student Assistance", "bc17fa75-16c6-4c6a-876c-ef0ba284ec6f"]
}, {
"Values": ["CBS Highest Priority", "College of Biological Science", "University of Hyper\\College of Biological Science", "0e0863fd-92e3-40e7-a832-0ca0afdaf850", "", "CBS Highest Priority", "0e0863fd-92e3-40e7-a832-0ca0afdaf850"]
},
View jssnippets.js
function donationformToJSON(){
var sections = $('td[class*="BBListingHeading"]');
collection = [];
sections.each(function(id,elem){
var section_name = $(elem).text();
var labels = $(elem).parents('tbody').find('label');
//compile dictionary for each form element
//separated by sections
jsonobject = {}
labels.each(function(id,lel){
@hyperking
hyperking / tableTojson.html
Created Aug 19, 2015
convert table element to json object
View tableTojson.html
<table>
<thead>
<tr>
<th>Name</th>
<th>Hobby</th>
<th>Favorite Music</th>
</tr>
</thead>
<tbody>
<tr class="tabledata">
@hyperking
hyperking / form.html
Last active Aug 29, 2015
form validator
View form.html
<h3>header</h3>
<form method="POST" id="myform" action="echo/html">
<label for="foo">First Name:</label>
<input type="input" id="foo">
<br>
<label for="bar">Last Name:</label>
<input type="input" id="bar">
<br>
<label for="baz">Email:</label>
@hyperking
hyperking / leaflet-ajax-links.js
Created Jun 17, 2014
Load Leaflet marker links with Ajax into a div container without page refreash
View leaflet-ajax-links.js
@hyperking
hyperking / SyncServerFoldertoDropbox.php
Created Jun 9, 2014
Remote Folder to Dropbox folder
View SyncServerFoldertoDropbox.php
<?php
// Set the timezone so filenames are correct
date_default_timezone_set('Europe/London');
// Backup all files in public_html apart from the gz
$siteroot = "/path/to/backup";
$dropbox_email='dropbox@email'; //Dropbox username
$dropbox_pass='pass'; // Dropbox password
View DropboxBackupDB.php
<?php
// Set the timezone so filenames are correct
date_default_timezone_set('Europe/London');
// Backup all files in public_html apart from the gz
$siteroot = "/path/to/backup";
$dropbox_email='dropbox@email'; //Dropbox username
$dropbox_pass='pass'; // Dropbox password
You can’t perform that action at this time.