Skip to content

Instantly share code, notes, and snippets.

View smorcuend's full-sized avatar
🎯
Focusing

Sergio Morcuende smorcuend

🎯
Focusing
View GitHub Profile
@smorcuend
smorcuend / index.js
Created May 31, 2017 13:56 — forked from just-boris/index.js
Gulp wrap pipe
/**
* Wrap gulp streams into fail-safe function for better error reporting
* Usage:
* gulp.task('less', wrapPipe(function(success, error) {
* return gulp.src('less/*.less')
* .pipe(less().on('error', error))
* .pipe(gulp.dest('app/css'));
* }));
*/
@smorcuend
smorcuend / index.html
Created July 12, 2017 08:13
JS Bin Simple RxJs Example // source https://jsbin.com/laxogo
<!DOCTYPE html>
<html>
<head>
<script src="https://npmcdn.com/@reactivex/[email protected]/dist/global/Rx.js"></script>
<meta name="description" content="Simple RxJs Example">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
onSelectUser(participantId:string) {
this.participantsService.findParticipantById(parseInt(participantId))
.debug("Loading participant from backend")
.subscribe(
participant => {
...
},
console.error
);
@smorcuend
smorcuend / ampe-app-service.ts
Last active October 20, 2017 11:53
Angular Model Pattern - use model in service
export class AuthApplicationService {
// inject all needed services
constructor(
private sessionService: SessionService,
private authService: AuthService
) {}
// orchestrate multi service execution
// note that subscription and cancelation are responsibility of the caller
@smorcuend
smorcuend / gql_search_stargazers.gql
Created November 7, 2017 19:43 — forked from katopz/gql_search_stargazers.gql
GraphQL Github Example : Search for top ten stargazers
// Try at : https://graphql-explorer.githubapp.com/
{
search(query: "language:JavaScript stars:>10000", type: REPOSITORY, first: 10) {
repositoryCount
edges {
node {
... on Repository {
name
descriptionHTML
stargazers {
@smorcuend
smorcuend / Settings.provider.ts
Created November 20, 2017 11:14
Settings provider example ionic
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/add/operator/map';
import { Observable } from 'rxjs/Observable'
import 'rxjs/add/observable/of';
import { Storage } from '@ionic/storage';
export class AppSettings {
website_host: string = null;
website_port: number = null;
@smorcuend
smorcuend / spec.vg
Last active December 1, 2017 15:00
Vega - Stackedchart
{
"$schema": "https://vega.github.io/schema/vega/v3.0.json",
"width": 500,
"height": 200,
"padding": 5,
"data": [
{
"name": "table",
"values": [
@smorcuend
smorcuend / setup.sh
Last active February 1, 2023 09:38
Initial Set-up to use Debian (10+) for developers
# First steps Debian based OS (10+)
# Debian 10.0 (Buster) (July 2019)
# Debian 11.0 (Bullseye) (August 2021)
## Install and Configure sudo
#su -
#apt install sudo -y
#sudo adduser serxius sudo
#usermod -aG sudo $USER
#include <Wire.h>
#include <WiFi.h>
#include <SparkFunBME280.h>
#include <SparkFunCCS811.h>
#include "Adafruit_Si7021.h"
#include <MQTT.h>
#define CCS811_ADDR 0x5A
#define BMP280_ADDR 0x76
#define SI2071_ADDR 0x40
@smorcuend
smorcuend / package.json.piece
Last active September 3, 2019 16:28
Angular scripts for bumping code
"release:changelog": "npm run conventional-changelog -- -p angular-bitbucket -i CHANGELOG.md -s -r 0",
"report-coverage": "codecov",
"preversion": "git checkout master && git pull origin master --tags",
"version": "npm run release:changelog && git add CHANGELOG.md package.json",
"postversion": "rm -rf dist/",
"bump": "npm run bump:patch",
"bump:patch": "npm version patch -m 'Bump version: %s';",
"bump:minor": "npm version minor -m 'Bump version: %s';",
"bump:major": "npm version major -m 'Bump version: %s';"