This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Updates Git submodules to latest commit | |
# use: | |
# $bash update-submodules.sh WORKING_DIRECTORY SUBMODULE_DIRECTORY SHOULD_UPDATE_GIT | |
# sample use: | |
# $ bash update-submodules.sh ~/code/my-repo my-submodule true | |
update_submodule () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Smooth scrolls to an element's position | |
* @param {string} buttonSelector | |
* @param {string} gotoSelector - element to scroll to | |
* @param {Number} yOffset - Y offset for scrolling | |
*/ | |
export const addScrollLink = ( | |
buttonSelector, | |
gotoSelector, | |
yOffset = 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Converts a UTC date into the proper format for ICS calendar files for DTSTAMP, DTSTART and DTEND | |
* @param {String} isoDateString, e.g. new Date().toISOString() | |
* @returns {String} formatted as UTC date for ICS files, e.g. 20220511T170000Z | |
*/ | |
const toICSDateFormat = (isoDateString) => { | |
const dateArray = isoDateString.split("T"); | |
const day = dateArray[0].replace(/-/g, ""); | |
const time = dateArray[1].replace(/[a-zA-Z]+/g, "").split(":"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* withData HOC - loads any data as Promise.all, shows loading icon and passes data along via props to children | |
*/ | |
import React, { Component } from 'react'; | |
import { Loading } from 'carbon-components-react'; | |
import ErrorModal from '../ErrorModal/ErrorModal'; | |
import RequestUtils from '../../utilities/RequestUtils'; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2019-07-16T16:43:35.573Z","extensionVersion":"v3.4.0"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<html> | |
<style> | |
body { | |
font: 10px sans-serif; | |
} | |
div { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dates = [{ | |
date : 'Feb 5 1924', | |
animal : 'Rat' | |
}, | |
{ | |
date : 'Jan 24 1925', | |
animal : 'Ox' | |
}, | |
{ | |
date : 'Feb 13 1926', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//functional | |
function logCar(object) { | |
this.color = object.color; | |
this.make = object.make | |
console.log('I\'m a ' + this.color + ' ' + this.make); | |
} | |
// object-oriented | |
(function(window){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var main = function() { | |
var _index; | |
function iterate() { | |
console.log(_index); | |
if (_index > 1) | |
setTimeout(iterate, 1000); | |
_index--; | |
} |
NewerOlder