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
| # Pass the env-vars to MYCOMMAND | |
| eval $(egrep -v '^#' .env | xargs) MYCOMMAND | |
| # … or ... | |
| # Export the vars in .env into your shell: | |
| export $(egrep -v '^#' .env | xargs) |
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 crypto = require('crypto'); | |
| module.exports = function(data) { | |
| return crypto.createHash('md5').update(data).digest("hex"); | |
| }; |
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
| /* | |
| * Async.gs | |
| * | |
| * Manages asyncronous execution via time-based triggers. | |
| * | |
| * Note that execution normally takes 30-60s due to scheduling of the trigger. | |
| * | |
| * @see https://developers.google.com/apps-script/reference/script/clock-trigger-builder.html | |
| */ |
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
| <html> | |
| <head> | |
| <title>Frogmore High School - Fetch array, combine and reorder</title> | |
| <script> | |
| // Step 1: Copy this html file locally as index.html | |
| // Step 2: Edit the <script> section to fetch data from these 2 urls | |
| // - Students: https://api.myjson.com/bins/vm1oz | |
| // - Marks: https://api.myjson.com/bins/fjccz | |
| // Step 3: Combine it into one single array by student id |
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
| <html> | |
| <head> | |
| var students = [ | |
| {"id":"905126","firstname":"Bob","lastname":"Smith","maths":9.9,"english":3.3}, | |
| {"id":"739559","firstname":"Harry","lastname":"Talbot","maths":5.6,"english":6.1}, | |
| {"id":"878999","firstname":"Pradosh","lastname":"Brown","maths":4.7,"english":8.1}, | |
| {"id":"421848","firstname":"Anna","lastname":"Ashley","maths":4.7,"english":5.5}, | |
| {"id":"073342","firstname":"Melanie","lastname":"Brown","maths":7.8,"english":4.2}, | |
| {"id":"503297","firstname":"Andrew","lastname":"Kimber","maths":8.3,"english":8.9}, | |
| {"id":"318977","firstname":"Peter","lastname":"Johnson","maths":9.3,"english":2.3}, |
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 moment = require('moment') | |
| // TRABAJAR AQUI | |
| module.exports = function timeago(date){ | |
| return moment(date).fromNow() | |
| } | |
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 gcd(a, b) { | |
| let arra = []; | |
| let arrb = [] | |
| for (let i=0; i<= a; i++){ | |
| if (a%i ===0) { | |
| arra.push(i); | |
| } | |
| } | |
| for (let j=0; j<= b; j++){ |
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
| ---- HTTP REQUEST ---- | |
| GET /index.html HTTP/1.1 | |
| Host: sdesalas.com | |
| User-Agent: Mozilla/5.0 (Windows NT 10.0) | |
| --- HTTP RESPONSE ---- |
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 = class Animal { | |
| constructor(energy) { | |
| this.energy = energy || 0; | |
| } | |
| move() { | |
| if (this.energy > 0) { | |
| console.log('moving...') | |
| this.energy = this.energy - 10; | |
| } else { | |
| console.log('cannot move.. (no energy)') |
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 logo from './logo.svg'; | |
| import './App.css'; | |
| import User from './User'; | |
| class App extends Component { | |
| render() { | |
| return ( | |
| <div className="App"> |