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
#!/usr/bin/env bash | |
arr="$@" | |
cool_strong=("${arr[@]:8:11}") | |
cute=("${arr[@]:20:4}") | |
all="I am $cool_strong and $cute" | |
echo $all | |
./arrays.bash awesome cool strong cute awesome #I am cool strong and cute |
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
cat: GNU: No such file or directory | |
cat: nano: No such file or directory | |
cat: 2.7.4: No such file or directory | |
cat: 'File:': No such file or directory | |
Uninstalling modules from DKMS | |
Attempting to install using DKMS | |
Creating symlink /var/lib/dkms/vboxguest/5.0.24/source -> | |
/usr/src/vboxguest-5.0.24 |
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
router.post("/", (req,res) => { | |
req.checkBody('name', 'Cannot be empty').notEmpty() | |
var entry = { | |
name:req.body.username, | |
email: req.body.email | |
} | |
Email.find({"email":entry.email}, (err, email) => { | |
console.log(email) |
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
Hitting books route gives back ReferenceError: Book is not defined | |
App.js | |
var express = require('express'); | |
var path = require('path'); | |
var favicon = require('serve-favicon'); | |
var logger = require('morgan'); | |
var cookieParser = require('cookie-parser'); | |
var bodyParser = require('body-parser'); |
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
MONGO DATA (doglist) | |
{ "_id" : ObjectId("58dc7505cefb0da47eab5205"), "name" : "buddy", "breed" : "white lab", "description" : "loves to play ball" } | |
INDEX.JS | |
var express = require('express'); | |
var router = express.Router(); | |
var mongo = require('mongodb') |
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
//src/index.js | |
import React from 'react' | |
import ReactDOM from 'react-dom' | |
ReactDOM.render( | |
<h2>Hello React with JSX</h2>, | |
document.getElementById('root'); | |
); |
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 Dropzone from 'react-dropzone'; | |
import AvatarEditor from 'react-avatar-editor' | |
class MyEditor extends React.Component { | |
constructor(props){ | |
super(props); | |
//set all properties to variable initialValues | |
let initialValues = { |
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
<div className="history">{this.state.history.map((item,index) => {index | |
IF (CURRENT ITEM IS === LAST ITEM) THEN DON'T PRINT CURRENT ITEM | |
return ( | |
<div key={index} onClick={this.goBackHistory.bind(this,index)}> | |
{item.title} | |
</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 Dropzone from 'react-dropzone'; | |
import './App.css'; | |
import AvatarEditor from 'react-avatar-editor' | |
class MyEditor extends React.Component { | |
render () { | |
return ( | |
<AvatarEditor |
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
function countPositivesSumNegatives(input) { | |
if (input == null){ | |
return [] | |
} else if (input == []){ | |
return Array.lenght === 0 | |
} else { | |
var blankArray = []; | |
var posCount = 0; | |
var negSum = 0; | |
for (var i = 0;i < input.length;i++){ |