Skip to content

Instantly share code, notes, and snippets.

View rivaadara111's full-sized avatar

Riva's student github rivaadara111

  • Vancouver, BC, Canada
View GitHub Profile
<header role="banner">
<div id="header">
<div id="header--primary">
<div class="l-wrapper sg cf">
<div class="logo">
<a href="/">
<img
src="<?php print file_create_url(path_to_theme() . '/assets/img/straight_logo_grey_small.png'); ?>"
@rivaadara111
rivaadara111 / header.js
Created April 3, 2018 18:06
Script that takes care of the primary dropdowns on the main header nav.
(function($, window, document) {
function toggleMenus() {
$('.reveal_js--trigger[data-target="drop1"][data-action="toggle"]').on('click', function(e) {
var clicked_obj = $(this),
target = clicked_obj.data('target'),
target_obj = $('.reveal_js--content[data-content="' + target + '"]'),
header_obj = $('#header'),
@rivaadara111
rivaadara111 / nearby-map.js
Created March 20, 2018 22:22
Object constructor that uses google maps api to show places/events to go nearby with sliding cards while accounting for insertion on infinite scroll
(function($) {
window.map_storage = [];
function NearbyMap(mapContainer) {
if (mapContainer.length == 0) {
return;
}
this.whereIam = mapContainer[0];
var self = this;
@rivaadara111
rivaadara111 / gs_infscroll_admin.php
Created February 7, 2018 00:48
An admin panel to keep track of infinite scroll items. Uses PHP & mySQL to build out custom form & results page.
//gs_infscroll_admin.info
name = GS Infinite Scroll Admin
description = Admin panel support for Infinite Scroll
project = "gs_infscroll_admin"
package = Custom
version = "7.x-1.0"
core = "7.x"
//gs_infscroll_admin.module
function gs_ads_menu() {
$items = array();
$items['admin/bookings/takeovers'] = array(
'type' => MENU_CALLBACK,
'description' => 'A form for booking ad takeovers.',
'page callback' => 'gs_ads_custom_page_display',
'access callback' => 'user_access',
'access arguments' => array('eck add booking takeover entities'),
'file' => 'includes/gs_ads.form.inc'
//using gmaps api to display locations with custom markers around vancouver
(function($) {
var marker_data;
$(document).ready(function() {
var jqxhr = $.get(document.getElementById('special-issues--map-canvas').getAttribute('data-src'), {}, function(data) {
marker_data = data;
}, 'text')
.error(function(jqXHR, textStatus, errorThrown) {
}).done(function() {
//a simple script to convert a csv to xml
<?php
$csvfile = 'DispensariesNEW.csv';
$xmlfile = 'dispensariesoutput.xml';
// Open csv to read as array
$csv = array_map('str_getcsv', file($csvfile));
array_walk($csv, function(&$a) use ($csv) {
(function($) {
// object constructor that creates itself and inserts itself onto the page
function Subscribe(whereIam) {
var self = this;
this.create_box = function(){
self.letterBlock = document.createElement('div');
self.letterBlock.setAttribute("id", "box--social");
self.letterBlock.className += 'box box--social sans-pro';
(function($, window, document) {
function toggleMenus() {
$('.reveal_js--trigger[data-target="drop1"][data-action="toggle"]').on('click', function(e) {
var clicked_obj = $(this),
target = clicked_obj.data('target'),
target_obj = $('.reveal_js--content[data-content="' + target + '"]'),
header_obj = $('#header'),