Skip to content

Instantly share code, notes, and snippets.

View johhansantana's full-sized avatar

Johhan Santana johhansantana

View GitHub Profile
@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 / 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;
@johhansantana
johhansantana / style.css
Created January 4, 2016 17:55
bootstrap dropdown on hover navbar
ul.nav li.dropdown:hover > ul.dropdown-menu {
display: block;
}
@johhansantana
johhansantana / style.css
Created December 26, 2015 17:54
collapse navbar on higher width
@media (min-width: 768px) and (max-width: 1175px) {
.navbar-collapse.collapse {
display: none !important;
}
.navbar-collapse.collapse.in {
display: block !important;
}
.navbar-header .collapse, .navbar-toggle {
display:block !important;
}