Skip to content

Instantly share code, notes, and snippets.

View martiuh's full-sized avatar

Tona González martiuh

View GitHub Profile
@martiuh
martiuh / fish-add-npm-global-to-path.md
Last active January 20, 2017 19:37
Fish shell: Add NPM Globals to PATH

fish version installed (2.4.0):

Ubuntu 16.04: LinuxBrew (Homebrew 1.1.6) npm 4.0.5

If you guys are having troubles running your globally installed npm modules, you just need to find the bin folder in my case is located here:

~/.linuxbrew/Cellar/node/7.0.0/bin

@martiuh
martiuh / webpack.config.normal.js
Last active February 10, 2017 16:47
Pequeño webpack.config para utilizar en production o en desarrollo, apoyo para mi artículo en Medium
//Este es el tipo más sencillo de un webpack.config
module.exports = {
entry: './app/mainEntry.js',
output: {
path: "/public",
filename: 'bundle.js'
},
module: {
loaders:[
{
var webpack = require('webpack')
//En lugar de usar un archivo .babelrc, agregamos la configuración de babelQuery aquí
var babelQuery = {presets: ["react", "es2015"], plugins:[]};
var webpackConfig = {
entry: './app/mainEntry.js',
output: {
path: "./public",
filename: 'bundle.js'
},
module: {
@martiuh
martiuh / package.json
Last active April 28, 2017 03:05
Example package.json that starts a fish file
//package.json
{
"scripts": {
"production" : "fish production.fish",
"start" : "node index.js"
}
}
@martiuh
martiuh / 1-Inicio.js
Created July 6, 2017 17:30
Tutorial GoT React-Web
//const render = ReactDOM.render;
//const Component = React.Component
const {render} = ReactDOM;
const {Component} = React;
render(
<h1>Hola Mundo</h1>,
document.getElementById('app')
);
@martiuh
martiuh / take.fish
Last active February 1, 2018 16:33
fish shell fn
#Similar to the take in zsh, creates a directory (if it's necesary creates parent directories) and take you to the directory
function take
mkdir -p $argv
cd $argv
#pwd
@martiuh
martiuh / .htaccess-node-shared-hosting
Last active April 2, 2020 06:38
shared-hosting-node-htaccess
DirectoryIndex disabled
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteEngine On
RewriteRule ^$ http://127.0.0.1:3001/ [P,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
@martiuh
martiuh / .eslintrc.js
Created November 17, 2018 02:54
Prefered .eslintrc configuration
module.exports = {
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
generators: true,
experimentalObjectRestSpread: true
},
sourceType: 'module',
allowImportExportEverywhere: false
},
@martiuh
martiuh / .htaccess-public-as-root
Last active December 8, 2018 17:30
.htaccess root as folder
# Map http://www.example.com to /public.
RewriteRule ^$ /public/ [L]
# Map http://www.example.com/x to /public/x unless there is a x in the web root.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ /public/$1
# Add trailing slash to directories within public
RewriteCond %{REQUEST_URI} !=^/movies/(\d*)/?$
RewriteRule ^movies/\d* /public/movies/movieId/ [L]