Skip to content

Instantly share code, notes, and snippets.

function myFavoriteThingsEachCity (sport, landmark, food) {
const object = {};
object[this.constructor.name]= {
team: this.sportsTeams[sport],
landMarks: this.landmarks[landmark],
food: this.bestFoods[food]
}
return object
}
@jdaly13
jdaly13 / Logged.js
Created August 9, 2019 04:42
Logged.js
import React from 'react';
import SideMenu from './SideMenu';
import Icon from 'react-native-vector-icons/Ionicons';
import {createDrawerNavigator, createStackNavigator, createAppContainer} from 'react-navigation'
import {Dimensions, Text} from "react-native";
var {height, width} = Dimensions.get('window');
import HomeScreen from '../screens/Home';
import ExercisesScreen from '../screens/Exercises';
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@jdaly13
jdaly13 / wordgame.html
Created March 17, 2015 19:30
word Game HTML setup
<div id="WordGAME" class="module moduColor_Dark hangman_jury" >
<div class="grid-container">
<div class="loader">Loading</div>
<div class='hide'>
<h2 class="module-header">Who Am I?</h2>
<div class="social">
<div class="currentScore">
<span>Correct</span>
<b>0</b>
</div>
/* Word Game jQuery plugin
*
* @param {object} options
* @returns {settings object that override default}
* jQuery plugin
* current dependencies are jQuery ... duh
*/
(function ($) {
$.fn.WordGame = function (options) {
var $container = $(this),
@jdaly13
jdaly13 / beEzK.markdown
Created April 10, 2014 03:58
A Pen by James Daly.
@jdaly13
jdaly13 / replace
Created September 4, 2013 22:54
start of replacement for marvel module
var relatedProductsContainer = $("#relatedProducts");
relatedProductsContainer.find('article').each(function(index, element) {
var containerHeight = []
var $element = $(element);
var liFirstChild = $element.find('div.product_content ul.product_description_list li:first-child');
var liLastChild = $element.find('div.product_content ul.product_description_list li:last-child');
var liOnlyChild = $element.find('div.product_content ul.product_description_list li:only-child');
var liSpanElement = liFirstChild.children('span:first-child');
var lastLiSpanElement = liLastChild.children('span');
var more = $('<a class="more_or_less more" style="cursor:pointer">more</a>'); //more trigger
@jdaly13
jdaly13 / marvel
Created September 4, 2013 22:48
related products module
<script>
//this should probably be added to an external file
setTimeout(function () {
(function (w, d) {
var smallerScreen = "(max-width:990px)"; // this is set in movies.scss as part of media query
var removedTextArray = [];
var removedTextArrayone = [];
var relatedProductsContainer = $("#relatedProducts"); //normally set in ini
var $ul = $('div.btn-dropdown ul');
var liFirstChild = $('div.product_content ul.product_description_list li:first-child');
@jdaly13
jdaly13 / gist:5701015
Created June 3, 2013 20:16
Inheritance Pattern Classical
function inherit(C, P) {
var F = function () {};
F.prototype = P.prototype;
C.prototype = new F();
C.uber = P.prototype;
C.prototype.constructor = C;
}
function Parent () {}
@jdaly13
jdaly13 / gist:5687482
Created May 31, 2013 19:42
callback function example vanilla js
var beverages = ['juice', 'soda', 'beer']
var func = function (thirsty, array, callback) {
array.push(thirsty);
var first = array[array.length - 1]
return callback(first);
}
func('water', beverages, function (param) {
return param