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
@nicobytes
nicobytes / userservice
Created April 4, 2017 22:39
userService
getAll(){
return {"results":[{"gender":"female","name":{"title":"miss","first":"آنیتا","last":"نكو نظر"},"location":{"street":"4842 شهید رحمانی","city":"قزوین","state":"گلستان","postcode":88633},"email":"آنیتا.نكونظر@example.com","login":{"username":"beautifulmouse467","password":"prayers","salt":"jCIISMlp","md5":"39762c237b92dd7b8e392669103afdcc","sha1":"1fd5de475c3e607247634fb512e079e143481de3","sha256":"d6945d3a277027ce84afca2fce0a78b32d3f518df0c90fb5c478367a2ae63e4d"},"dob":"1957-12-19 17:41:58","registered":"2002-06-12 01:25:09","phone":"021-59610882","cell":"0947-822-5292","id":{"name":"","value":null},"picture":{"large":"https://randomuser.me/api/portraits/women/17.jpg","medium":"https://randomuser.me/api/portraits/med/women/17.jpg","thumbnail":"https://randomuser.me/api/portraits/thumb/women/17.jpg"},"nat":"IR"},{"gender":"male","name":{"title":"mr","first":"brandão","last":"lopes"},"location":{"street":"6004 rua são pedro ","city":"bragança","state":"santa catarina","postcode":77776},"email":"brand
@nicobytes
nicobytes / load.ts
Created April 16, 2017 16:37
Loading customs
let loading = this.loadingCtrl.create({
spinner: 'hide',
content: `
<div class="custom-spinner-container">
<div class="custom-spinner-box"></div>
</div>`,
duration: 5000
});
@nicobytes
nicobytes / steps.md
Last active September 21, 2022 06:06
Remeber you fuck steps, config for deploy django project

Conectarse con el server

  1. ssh user@your_ip
  2. Generar llave ssh-keygen -b 4096 (dentro de .ssh)
  3. Enviar llave al server ssh-copy-id -i .ssh/name.pub user@your_ip
  4. Conectar: ssh user@your_ip

Install Nginx

  1. update apt-get update
@nicobytes
nicobytes / test-provider.spec.ts
Last active August 2, 2017 12:51
Test for provider
import { TestBed, inject, fakeAsync, tick } from '@angular/core/testing';
import { YourService } from './your.service';
describe('Provider: YourService', () => {
//Arrange
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
{ provide: YourService, useClass: YourService },
@nicobytes
nicobytes / app.component.ts
Created August 8, 2017 15:07
check platform
export class YourPage {
constructor(
...
private platform: Platform,
) {
if(this.platform.is('cordova')){
this.initPush();
}
}
//component ts
@Component({
selector: 'your-component',
templateUrl: 'your-component.html',
})
export class YourComponent {
@Input() photo: string;
constructor(
@nicobytes
nicobytes / .ts
Created September 11, 2017 18:44
example
getVendedores(){
let vendedores = [];
let sizeVendedores = 0;
return new Promise((resolve, reject)=>{
this.fireDatabase.list('/supervidores/idSupervidor/VendedoresList')
.subscribe(list =>{
sizeVendedores = list.length;
list.forEach(vendedor=>{
let imei = vendedor.imei;
this.fireDatabase.object('/vendedores/'+imei)
private checkSession(){
if(this.auth.isLoggedIn()){
this.navMaster.setRoot('HomePage');
}else{
this.navMaster.setRoot('LoginPage');
}
this.splashScreen.hide();
}
private generateMarkers(latitude:number, longitude: number, limit: number){
let markers: any[] = [];
for(let i =0;i<limit;i++){
markers.push({
title: 'hola ' + i,
position: {
lat: latitude + Math.random() * (1 - (-1)) + (-1),
lng: longitude + Math.random() * (1 - (-1)) + (-1)
}
});
@nicobytes
nicobytes / pipelines.yml
Created October 6, 2017 04:04
Install chrome for CI
image: node:6.9.4
pipelines:
branches:
master:
- step:
script:
- apt-get update; apt-get install -y gettext-base;
- echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
- set -x && apt-get update && apt-get install -y xvfb google-chrome-stable