Skip to content

Instantly share code, notes, and snippets.

View xola139's full-sized avatar
๐Ÿ™‚
always learning something

Raul Corona xola139

๐Ÿ™‚
always learning something
View GitHub Profile
@xola139
xola139 / PopulateExample
Created April 27, 2018 16:24
Simple example populate with mongoose, You can use data dummy for create an example.
var mongoose = require('mongoose');
var config={ conectDB:{
link:'her you link mongodb'
}
};
var ImagesSchema = new mongoose.Schema({
id: String,
avatar: String,
@xola139
xola139 / README.md
Created April 24, 2018 16:31 — forked from debashisbarman/README.md
A Twitter bot that can retweet in response to the tweets matching particluar keyword (https://goo.gl/4whEIt)

#Creating a Twitter bot with Node.js Learn how you can create your own Twitter bot using Node.js and the new Twitter API. The bot will auto retweet in response to tweets with some particular hashtags. (https://goo.gl/4whEIt)

##Tools we need Here are the tools weโ€™ll be using to create the botโ€Šโ€”โ€Š

  • Node.js installed in your machine
  • A registered Twitter account

Create a Twitter application

-++Deploying an Angular 4 App**
https://www.youtube.com/watch?v=nxV3weqMzYo
<button mat-button color="primary" (click)="hideme[i] = !hideme[i]">Ver fotos</button>
<mat-card-content [hidden]="!hideme[i]" >
@xola139
xola139 / gist:30cf890710eeff777187192e5741ade1
Created March 4, 2018 18:36
When you project is old so you need update my dependencies
As it is an "old project" I was trying to update my dependencies, with the following steps:
Run npm update
npm install -g npm-check-updates
ncu -u
@xola139
xola139 / gist:6d4167f02edbffae66022bd70d55873b
Created February 25, 2018 00:29
When you want create, copy or move files from ubuntu to partition windows, use:
open up terminal:
1.create a spot to mount to:
sudo mkdir /media/windows
2.now take ownership or allow other users to use the folder:
sudo chmod 777 /media/windows
3.find out what device the partition is on:
sudo fdisk -l
@xola139
xola139 / Invalid Host Header NGROK
Created February 19, 2018 19:17
When Invalid Host Header when ngrok tries to connect to Angular or React dev server
When Invalid Host Header when ngrok tries to connect to Angular or React dev server use this form for run ngrok.
ngrok http 8080 -host-header="localhost:8080"
ngrok http --host-header=rewrite 8080
angular.module('myModuleApp').directive('itemProducto', function() {
return{
restrict: 'E',
scope: {
item: '=',
pathimage: '@',
urldisable: '@'
},
templateUrl: 'someTemplate.html',
link : function(scope, element, attrs){
@xola139
xola139 / gist:18bdbb4779922e461acad58a0f504ea2
Created January 22, 2018 17:30
Comand install .jar in M2
mvn install:install-file -Dfile=path.jar -DgroupId=com.ccm -DartifactId=name.jar -Dversion=1.0 -Dpackaging=jar
where
name.jar = only name .jar
path.jar = is rute where is file .jar
@xola139
xola139 / gist:da6538caab0f58752b57322ae8b4a033
Created April 12, 2017 15:47
Agregar pdf en html apartir de un flujo de datos base63
//se crea el objeto para poder embeberlo dentro del html 'arrayFile' es el flujo de datos
var objbuilder = '';
objbuilder += ('<object width="100%" height="100%" data="data:application/pdf;base64,');
objbuilder += (arrayFile);
objbuilder += ('" type="application/pdf" class="internal">');
objbuilder += ('<embed src="data:application/pdf;base64,');
objbuilder += (arrayFile);
objbuilder += ('" type="application/pdf" />');
objbuilder += ('</object>');
@xola139
xola139 / scrapTwit.js
Last active February 21, 2017 21:54
WebScrapping Twitter with Casperjs, this script it can the next command : casperjs scrapTwit.js --account_name=xola139
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g, '');}
String.prototype.ltrim=function(){return this.replace(/^\s+/,'');};
String.prototype.rtrim=function(){return this.replace(/\s+$/,'');};
String.prototype.fulltrim=function(){return this.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g,'').replace(/\s+/g,' ');};
Date.prototype.MMDDYYYY = function() {
var yyyy = this.getUTCFullYear().toString();
var mm = (this.getUTCMonth()+1).toString(); // getMonth() is zero-based
var dd = this.getUTCDate().toString();