Skip to content

Instantly share code, notes, and snippets.

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

Jose Carlos Ixcoatl Gomez Briones brion25

🏠
Working from home
View GitHub Profile
module.exports = function(first,last){
var msg = 'Hi Mr. '.concat(last).concat(', or maybe I should say: Hi! ').concat(first);
console.log(msg);
}
class Greetings{
spanish(){
let msg = `Hello Mr. ${this.last}, or Maybe I should say: Hi ${this.first}!`;
return msg;
}
english(){
let msg = `Hola Sr. ${this.last}, o quisas deba decir: Hola ${this.first}!`;
return msg;
}
}
@brion25
brion25 / Actions.js
Created November 4, 2015 20:34
Say Hello App, to read more details about it, please go to my blog: http://brion25.blogspot.com
export default (document)=>{
let btn = document.querySelector('#say-hello'),
txt = document.querySelector('#your-name'),
hello = document.querySelector('#hello-you');
btn.onclick =()=>{
hello.textContent = 'Hello '.concat(txt.value).concat('!');
}
}
var rest = require('rest-facade'),
POST_ID = 1,
Posts = new rest.Client('http://jsonplaceholder.typicode.com/posts/:id'),
CommentsPerPost = new rest.Client('http://jsonplaceholder.typicode.com/posts/:id/comments');
Posts
.get({id:POST_ID})
.then(function(post){
console.log("--- POST ---");
console.log(post);
function myFunc(){
var prvValue = 5;
this.setPrvValue = function(val){
prvValue = val;
}
this.getPrvValue = function(){
return prvValue;
}
}
angular.module('myApp',[])
.controller('myCtrl',['myService',function(service){
var self = this;
self.values = [];
self.reloadValues = function(){
service.getValues().then(
function(values){
self.values = values;
describe('myCtrl Tests',function(){
var ctrl = null,
service = null;
beforeEach(module('myApp'));
beforeEach(inject(function(_myService_,$controller){
ctrl = $controller('myCtrl',{
myService : _myService_
});
describe('myCtrl Tests',function(){
var ctrl = null,
goodResponse = [1,2,3,4,5],
badResponse = new Error('Something is failing...'),
serviceMock = function(successful){
return {
getValues : function(){
return {
then : function(resolve,reject){
if(successful){
/**
* We just require 3 libraries: webpack, the dev server of webpack and our config file
*/
var WebpackDevServer = require('webpack-dev-server'),
webpack = require('webpack'),
config = require('./webpack.config.js');
/**
* First, we need to compile our configuration, let's translate our configuration to webpack instrutions.
* This process is exactly the same that we see when we run just webpack, it will create a new "bundle" file
@brion25
brion25 / gulpfile.js
Last active January 13, 2016 22:00
Gulp : Webpack vs Browserify
var gulp = require('gulp'),
webpack = require('webpack-stream'),
browserify = require('browserify'),
uglify = require('gulp-uglify')
source = require('vinyl-source-stream'),
buffer = require('vinyl-buffer');
gulp.task('browserify',function(){
return browserify('./app/entry.js')
.bundle()