docker build -t name -t TAG builds image from dockerfile
docker run -v pwd
/app:/app -p 3000:3000 -it -d ana/name
docker ps
docker exec -it /bin/bash
This file contains 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
// In your component, add this var and functions: | |
let columnBeingDragged = null; | |
const onDragStart = e => { | |
columnBeingDragged = e.target.dataset.columnIndex; | |
}; | |
const onDrop = e => { | |
e.preventDefault(); |
This file contains 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
git branch -D $(git branch | grep -v master) |
This file contains 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
// Scene | |
const container = document.querySelector('#scene-container'); | |
var scene = new THREE.Scene(); | |
scene.background = new THREE.Color('blue'); | |
//scene.add(stuff) | |
// Renderer | |
const renderer = new THREE.WebGLRenderer({alpha: true}); | |
renderer.setSize(container.clientWidth, container.clientHeight); |
This file contains 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 from 'react'; | |
import PropTypes from 'prop-types'; | |
import CarouselButton from './CarouselButton'; | |
const Carousel = ({ children }) => { | |
const scroll = direction => { | |
const carousel = document.querySelector('#carousel'); | |
const step = 30; // scrolling by 30px | |
carousel.scrollTop = |
This file contains 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 a = [{grape: 1}, {orange: 2}, {peach: 3}]; | |
let b = {}; | |
// turn b into {grape: 1, orange:2, peach: 3} | |
a.forEach((el, i) => { | |
b[Object.keys(a[i])] = el[Object.keys(el)[0]] | |
}) | |
// using object destructuring syntax | |
let [{grape}, {orange}, {peach}] = a; |
This file contains 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
function solution(A) { | |
// write your code in JavaScript (Node.js 8.9.4) | |
let sortedA = A.sort(); | |
for (let i = 0; i < sortedA.length; i++) { | |
console.log(sortedA.indexOf(sortedA[i] + 1)) | |
if (sortedA.indexOf(sortedA[i] + 1) === -1) { | |
return sortedA[i] + 1; | |
} | |
} |
This file contains 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 path = require("path"); | |
module.exports = { | |
entry: "./main.js", | |
output: { | |
path: path.resolve(__dirname, "dist"), | |
filename: "bundle.js", | |
publicPath: "/dist" | |
}, | |
module: { |
This file contains 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
function elementIsVisible(el) { | |
var docViewTop = $(window).scrollTop(); | |
var docViewBottom = docViewTop + $(window).height(); | |
var elTop = $(el).offset().top; | |
var elBottom = elTop + $(el).height(); | |
return ((elBottom - $(el).height() <= docViewBottom) | |
&& (elTop + $(el).height() >= docViewTop)); | |
} |
This file contains 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
.myDiv { | |
border: 2px solid beige; | |
border-image: linear-gradient(to top, beige 95%, rgba(0,0,0,0) 95%); /* Change direction, color and height accordingly */ | |
border-image-slice: 1; | |
} |
NewerOlder