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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
func main() { | |
// create a single channel of size 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
function gifit { | |
gifthis=1 | |
input_file="" | |
output_file=output.gif | |
gifsize=900x600 | |
if [[ $# -eq 0 ]]; then | |
gifthis=0 | |
echo "Usage: gifit <input_mov_file> <gif pixel size ie: 1200x800> <output_gif_filename>" | |
echo " converts mov files into <gif_size> gif files" | |
fi |
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
// this is one method of a component from my SoundClone app | |
buildSearchPool () { | |
if (this.state.query === '') { | |
this.setState({ | |
searchPool: [] | |
}) | |
} else { | |
const pool = []; | |
Object.keys(this.props.songs).filter((songId) => { |
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'); // You know what path is for | |
var webpack = require('webpack'); // obviously it needs webpack | |
module.exports = { | |
/* | |
the entry key defines the file that will be the entry point. In our case, index.jsx | |
*/ | |
entry: path.join(__dirname + '/index.jsx'), | |
/* | |
the output key names the file and location of the transpiled javascript |
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'; | |
var nurse = "world"; | |
class MyApp extends React.Component { | |
render(){ | |
return ( | |
<div className="hi-there"> | |
<h2>Hellooooooooo, {nurse}</h2> | |
</div> | |
); |
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 {render} from 'react-dom'; | |
import MyApp from './MyApp'; | |
class App extends React.Component { | |
render() { | |
return ( | |
<MyApp /> | |
); |
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
<html> <!-- fun fact: you don't have to declare DOCTYPE for HTML5. So stop it. --> | |
<head> | |
<title>React4Beginners</title> | |
</head> | |
<body> | |
<h1>Hey, oh boy! Hi there, World!</h1> | |
</body> | |
</html> |
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
const express = require('express'); // this is just so easy. Read up on it later | |
const app = express(); // now 'app' is an express application | |
const path = require('path'); // this will help you tell Node where your files are | |
// when the app 'gets' a request, it will send the index.html file | |
app.get('/', (req, res)=>{ | |
res.sendFile(path.join(__dirname + '/index.html')); | |
}); |