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
javascript: (function(e, s) { | |
e.src = s; | |
e.onload = function() { | |
jQuery.noConflict(); | |
console.log('jQuery injected'); | |
}; | |
document.head.appendChild(e); | |
})(document.createElement('script'), '//code.jquery.com/jquery-latest.min.js') |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 debug = process.env.NODE_ENV !== "production"; | |
var webpack = require('webpack'); | |
module.exports = { | |
context: __dirname, | |
devtool: debug ? "inline-sourcemap" : null, | |
entry: "./js/scripts.js", | |
output: { | |
path: __dirname + "/js", | |
filename: "scripts.min.js" |
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
// default inside a ./reducers folder | |
import { combineReducers } from "redux"; | |
import tweets from "./tweetsReducer"; | |
import user from "./userReducer"; | |
export default combineReducers({ | |
tweets, | |
user | |
}); |
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"); | |
var webpack = require("webpack"); | |
module.exports = { | |
entry: [ | |
'webpack-dev-server/client?http://0.0.0.0:8080', // WebpackDevServer host and port | |
'webpack/hot/only-dev-server', // "only" prevents reload on syntax errors | |
"./src/app.js" // appʼs entry point | |
], | |
devtool: "source-map", |
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 WebpackDevServer = require("webpack-dev-server"); | |
var webpack = require("webpack"); | |
var config = require("./webpack.config.js"); | |
var server = new WebpackDevServer(webpack(config), { | |
publicPath: config.output.publicPath, | |
hot: true, | |
noInfo: false, | |
historyApiFallback: true, | |
stats: {colors: true} |
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
node_modules/ |
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: [ | |
'./src/app.js', | |
], | |
devtool: 'source-map', | |
output: { | |
path: __dirname+'/dist', | |
filename: 'bundle.js', |
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
<?php | |
function inverse($x) { | |
if(!$x) | |
throw new Exception("Division by zero."); | |
return 1 / $x; | |
} | |
try { | |
echo inverse(5)."\n"; | |
echo inverse(0)."\n"; |
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
server { | |
listen 80; | |
server_name localhost; | |
root [directory_path]/public; | |
index index.php | |
location / { | |
try_files $uri $uri/ /index.html; | |
if (!-e $request_filename){ rewrite ^(.*)$ /index.php last; } |
OlderNewer