Skip to content

Instantly share code, notes, and snippets.

View johhansantana's full-sized avatar

Johhan Santana johhansantana

View GitHub Profile
@johhansantana
johhansantana / next.config.js
Created March 26, 2017 19:32
Custom webpack in next.js
module.exports = {
webpack: (config, { dev }) => {
// Perform customizations to config
config.node = {
fs: 'empty'
};
return config
}
}
@johhansantana
johhansantana / index.html
Created March 16, 2017 12:38
Angular animate using angular-animate
<div class="animate" ng-hide="loading">
...
</div>
@johhansantana
johhansantana / flexbox.css
Created March 6, 2017 21:38
Easy flexbox predefined css
/**
Flex css start
*/
.containerFlexRow {
display: flex;
flex-direction: row;
}
.wrapFlex {
flex-wrap: wrap;
@johhansantana
johhansantana / equilibriumIndex.js
Created February 17, 2017 00:05
Find Equilibrium index in array in javascript
const findEquilibrium = A => {
let firstArray = [];
let firstSum = 0;
let secondArray = [];
let secondSum = 0;
for (let i = 0; i < A.length; i++) {
let currentIndex = i + 1;
firstArray.push(A[i]);
@johhansantana
johhansantana / .htaccess
Last active September 25, 2016 19:53
fix angular refresh not found
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(.*) /appname/index.html [NC,L]
# or /index.html [NC,L]
</IfModule>
@johhansantana
johhansantana / app.js
Last active July 5, 2016 20:18
trust ng-src video urls $sce
app.filter('trusted', function ($sce) {
return function (url) {
return $sce.trustAsResourceUrl(url);
}
});
@johhansantana
johhansantana / form.html
Created January 29, 2016 18:49
Simple contact form in php
<form name="form" id="form" action="mail.php" method="POST">
<div class="row">
<div class="col-md-6">
<label for="name">NAME:</label>
<input type="text" id="name" name="name" class="form-control" required>
</div>
<div class="col-md-6">
<label for="email">EMAIL:</label>
<input type="email" id="email" name="email" class="form-control" required>
@johhansantana
johhansantana / install-node-and-npm.sh
Last active January 29, 2016 13:20
install node and npm
vim ~/.bashrc
make sure in your bashrc file you have the following:
export PATH=$HOME/local/bin:$PATH
export PATH="$PATH:$HOME/npm/bin"
# this one is optional, add it it doesn't work at the end
export NODE_PATH="$NODE_PATH:$HOME/npm/lib/node_modules"
@johhansantana
johhansantana / gist:8fe4a998301935de622f
Created January 18, 2016 16:49
export mongo db collection
mongoexport --host localhost --port 3001 --db meteor --collection collection_name --out collection_name.json
// source http://stackoverflow.com/a/24551885/3632722
@johhansantana
johhansantana / style.css
Created January 15, 2016 20:52
delay css ng-if
.slide-up{
position:relative;
--webkit-transition: 0.5s ease-in-out all;
-moz-transition: 0.5s ease-in-out all;
-o-transition: 0.5s ease-in-out all;
transition: 0.5s ease-in-out all;
}
.slide-up.ng-enter{
--webkit-transition-delay: 0.5s;
-moz-transition-delay: 0.5s;