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
| # Navigate to parent file of your sites, and run this to list the "node_modules" folders and their sizes | |
| $ find . -name "node_modules" -type d -prune -print | xargs du -chs | |
| # Then run this code to actually delete those "node_modules" folders, you will need to run `npm install` inside each folder you want to reinstall node_modules into | |
| $ find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \; |
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
| document.querySelectorAll('a[href^="#"]').forEach(anchor => { | |
| anchor.addEventListener('click', function (e) { | |
| e.preventDefault(); | |
| document.querySelector(this.getAttribute('href')).scrollIntoView({ | |
| behavior: 'smooth' | |
| }); | |
| }); | |
| }); |
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 axios from 'axios'; | |
| let one = "https://api.storyblok.com/v1/cdn/stories/health?version=published&token=wANpEQEsMYGOwLxwXQ76Ggtt" | |
| let two = "https://api.storyblok.com/v1/cdn/datasources/?token=wANpEQEsMYGOwLxwXQ76Ggtt" | |
| let three = "https://api.storyblok.com/v1/cdn/stories/vue?version=published&token=wANpEQEsMYGOwLxwXQ76Ggtt" | |
| axios.all([requestOne, requestTwo, requestThree]).then(axios.spread((...responses) => { | |
| const responseOne = responses[0] | |
| const responseTwo = responses[1] | |
| const responesThree = responses[2] |
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 jqry = document.createElement('script'); | |
| jqry.src = "https://code.jquery.com/jquery-3.3.1.min.js"; | |
| document.getElementsByTagName('head')[0].appendChild(jqry); | |
| jQuery.noConflict(); |
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
| *.js eol=lf | |
| *.jsx eol=lf | |
| *.json eol=lf |
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
| /////////////// | |
| // index.js: // | |
| /////////////// | |
| var fs = require('fs') | |
| fs.readFile('./users.json', 'utf-8', function(err, data) { | |
| if (err) throw err | |
| var arrayOfObjects = JSON.parse(data) |
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
| module.exports = function () { | |
| var faker = require('faker'); | |
| var _ = require('lodash'); | |
| var numberOfRecords = 100; | |
| return { | |
| people: _.times(numberOfRecords, function (n) { | |
| return { | |
| id: n, | |
| name: faker.name.findName(), |
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> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Website</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <link rel="stylesheet" href="style/style.css"> | |
| </head> | |
| <body> |
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
| <?php | |
| $value = 12; | |
| echo 'Text before ',($value > 10 ? 'true' : 'false'); |
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
| <?php | |
| $timestamp = strtotime($result->datetime); | |
| echo date("Y-m-d H:i:s", $timestamp); |
NewerOlder