Skip to content

Instantly share code, notes, and snippets.

View codedcontainer's full-sized avatar
💭
Learning about GraphQL through a Pluralsight.

codedcontainer

💭
Learning about GraphQL through a Pluralsight.
View GitHub Profile
@codedcontainer
codedcontainer / parallax.ts
Created January 25, 2018 17:34
Parallax with TypeScript
class parallax {
private _backgroundElement:string;
private _containerElement:string;
set containerElement(name: string){
this._containerElement = name;
}
set backgroundElement(name: string){
this._backgroundElement = name;
}
@codedcontainer
codedcontainer / formatStringArray.js
Created October 16, 2017 17:42
Make every word in a sentence capitalized
function formatReportTitle(objectKeys){
var formattedReportArray = [];
for (a = 0; a <= objectKeys.length -1; a++){ //loop through array of report types/object keys
var splitString = objectKeys[a].split("_"); //slpit the array by "_"
//loop through each string item
for (var b = 0; b <= splitString.length -1; b++ ){
splitString[b] = splitString[b].split(''); //splits string into array of letters
splitString[b][0] = splitString[b][0].toUpperCase(); //makes first letter capitalizes
splitString[b]= splitString[b].join(''); //converts array of letter back to word
}
@codedcontainer
codedcontainer / scss
Created November 15, 2016 17:08
Flexbox internet explorer fix for bootstrap 4 in sass
//fix for flexbox in internet explorer
$list: xm sm md lg xl;
@for $i from 1 through 12{
@each $b in $list{
.ie .col-#{$b}-#{$i}{
padding-left: 0px !important; padding-right: 0px !important;
}
}
}
@codedcontainer
codedcontainer / bookmark.html
Created October 19, 2016 13:45
Allows for the use of anchor bookmark links.
<a href="/#/:policy.html/?scrollTo=scope" target="_self">Link</a>
<h2 id="scope">Scope</h2>
@codedcontainer
codedcontainer / ie.js
Created October 18, 2016 18:24
Flex box does not work with ie 11 > 9, you need to adjust the height for ie 11
function ieTag(){
var ie = {
eleven: 'rv:11',
ten: 'MSIE 10',
nine: 'MSIE 9'
};
var appVersion = window.navigator.appVersion;
for( key in ie )
@codedcontainer
codedcontainer / angular manual link.js
Created April 22, 2016 14:43
A manual way of splitting a Angular object so that you can add items to rows in Bootstrap.
@codedcontainer
codedcontainer / Angular Icon Loop.js
Created April 22, 2016 14:40
Allows you to repeat a number of icons numerous times such as if you were using a for loop in JavaScript
<i class="material-icons md-48" ng-repeat="_ in ((_ = []) && (_.length=3) && _) track by $index">star</i>
@codedcontainer
codedcontainer / broken-image.css
Created March 10, 2016 15:43
Broken image placeholder design
img {
/* Same as first example */
min-height: 50px;
}
img:before {
content: " ";
display: block;
position: absolute;
@codedcontainer
codedcontainer / YoutubeSlider.js
Created February 26, 2016 15:36
YouTube API with control settings. Should change height of slide area when the video is played or stopped.
/* youtube video in slider */
// Load the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/player_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// Replace the 'ytplayer' element with an <iframe> and
// YouTube player after the API code downloads.
@codedcontainer
codedcontainer / fullCalendar
Created February 11, 2016 15:13
Creates a new instance of FullCalendar from an XML file (example)
function fullCalendar()
{
$('#calendar').fullCalendar(
{
eventBackgroundColor: '#7A1705',
eventBorderColor: '#7A1705',
header:
{
left: 'title',
center: '',