Skip to content

Instantly share code, notes, and snippets.

View nicobytes's full-sized avatar
🏠
Working from home

Nicolas Molina Monroy nicobytes

🏠
Working from home
View GitHub Profile
function main(data){
return data.name;
}
function main(data){
return data.name;
}
@nicobytes
nicobytes / multipleTest1.js
Last active February 11, 2016 00:18
multipleTest1
function multipleTest1() {
// Test
var result = calculator.multiply( 3, 3 );
//Assert Result is expected
if( result === 9 ){
console.log( "Test Passed" );
}else{
console.log( "Test Failed" );
}
}
var calculator = {
multiply: function( numberA, numberB ){
return numberA * numberB;
}
};
multipleTest1();
module.exports = function( config ){
config.set({
browsers: ['PhantomJS'],
frameworks: ['mocha'],
files: [
//Vendors
"www/build/js/vendors.js",
//Vendors for testing
"www/lib/angular-mocks/angular-mocks.js",
'www/lib/chai/chai.js',
@nicobytes
nicobytes / gulp.js
Last active April 12, 2016 14:48
mi gulp
gulp.task('server', function() {
browserSync.init({
host: "0.0.0.0",
notify: false,
port: 8080,
server: {
baseDir: ['User/templates/User', 'app']
},
});
});
@nicobytes
nicobytes / refactoring.js
Last active June 3, 2016 14:49
refactoring
/* Avoid */
var abc = function(z) {
var x = false;
if( z > 10 ){
return true;
}
return x;
};
/* Recommend */
var isTenOrGreater = function( value ){
@nicobytes
nicobytes / example.html
Created June 6, 2016 14:44
Ejemplo del uso del componente
<ica-accordion auto-open="false">
<ica-accordion-item type="item" title="52569" badge-left-icon="icon-info" item-note="Bogotá D.C. - Cúcuta / 7 de Octubre">
<!-- Body -->
<div class="row">
<div class="col padding">
<p>El texto que deba Ir.........</p>
</div>
</div>
</ica-accordion-item>
<html>
<head>
<style>
body {
background: #4E8EF7;
}
svg{
position:fixed;
top:50%;
left:52%;
@nicobytes
nicobytes / promesa
Created April 4, 2017 13:55
ejemplo
return new Promise(resolve => {
this.http.get('https://randomuser.me/api/?results=25')
.map(res => res.json())
.subscribe(data => {
this.data = data.results;
resolve(this.data);
});
});