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
| // Typescript | |
| import moment, {Moment} from "moment"; | |
| // Generate a range of dates | |
| export function getDates(startDate: Moment, days: number): Date[] { | |
| var dateArray: Date[] = []; | |
| const currentDate = moment(startDate); // Clone the date or die! | |
| const endDate = startDate.add(days, "days"); |
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
| # /etc/systemd/system/docker.service.d/override.conf | |
| [Service] | |
| ExecStart= | |
| ExecStart=/usr/bin/dockerd -H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375 -H tcp://0.0.0.0:2376 |
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
| const randomint = (start, end) => { | |
| let diff = end - start; | |
| return Math.floor(Math.random() * diff) + start | |
| } | |
| const chance = (rate=0.5) => { | |
| return Math.random() > rate ? true : false; | |
| } | |
| const pad = (n, width, z) => { |
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
| # Rest of BASH OR SZH FILE | |
| # ... | |
| # ADD THE FOLLOWING | |
| # Check for utils scripts / shortcuts and import | |
| if [ -f '.utilsrc' ]; then source '.utilsrc'; fi |
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
| import os | |
| import uuid | |
| from django.conf import settings | |
| from django.db import models | |
| from django.utils.deconstruct import deconstructible | |
| @deconstructible | |
| class PathAndRename(object): |
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
| import React, { Component } from 'react'; | |
| let list_data = [ | |
| "Cat", | |
| "Dog", | |
| "Fish", | |
| "Parrot", | |
| "Rabbit" | |
| ] |
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
| ... | |
| class App extends Component { | |
| render() { | |
| return ( | |
| <div> | |
| <h1>List of lists</h1> | |
| <List data={top_animals} title="Top animals" /> | |
| <List data={other_animals} title="Other animals"/> | |
| </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
| import React, { Component } from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import ListItem from './ListItem'; | |
| class List extends Component { | |
| render() { | |
| // Create variable with mapped data | |
| let list_items = this.props.data.map(function(item, index) { |
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
| let other_animals = [ | |
| "koala", | |
| "Chimp", | |
| "Tiger", | |
| "Shark", | |
| "Humming bird", | |
| null, | |
| false, | |
| 1 | |
| ] |
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
| import React, { Component } from 'react'; | |
| import PropTypes from 'prop-types'; | |
| class ListItem extends Component { | |
| render() { | |
| return ( | |
| <li>{this.props.text}</li> | |
| ) | |
| } | |
| } |
NewerOlder