Skip to content

Instantly share code, notes, and snippets.

View robertohuertasm's full-sized avatar
🦀
friendly rustacean

Roberto Huertas robertohuertasm

🦀
friendly rustacean
View GitHub Profile
@robertohuertasm
robertohuertasm / cloudSettings
Last active April 25, 2018 08:14
Visual Studio Code Sync Settings GIST
{"lastUpload":"2018-04-25T08:14:23.411Z","extensionVersion":"v2.9.0"}
{
"extends": [
"tslint:latest"
],
"rules": {
"quotemark": [
"single"
],
"ordered-imports": [
false
@robertohuertasm
robertohuertasm / Instructions
Last active January 1, 2018 10:07
IOTA node with docker
Some interesting urls:
- https://github.com/bluedigits/iota-node
- https://forum.helloiota.com/2424/Setting-up-a-VPS-IOTA-Full-Node-from-scratch
Basically, run this:
```sh
docker run -d -p 14265:14265 -p 15777:15777 -p 14777:14777/udp --name iri iotaledger/iri /usr/bin/java -XX:+DisableAttachMechanism -Xmx8g -Xms256m -Dlogback.configurationFile=/iri/conf/logback.xml -Djava.net.preferIPv4Stack=true -jar iri.jar -p 14265 -u 14777 -t 15777 --remote
#finally
docker run -d -p 18600:18600 -p 16600:16600 --name nelson romansemko/nelson -r localhost -i 14265 -u 14777 -t 15777 --neighbors "mainnet.deviota.com/16600 mainnet2.deviota.com/16600 mainnet3.deviota.com/16600 iotairi.tt-tec.net/16600"
@robertohuertasm
robertohuertasm / errorhandler_angular.ts
Last active December 23, 2018 02:03
never miss error ionic
class CustomErrorHandler extends ErrorHandler {
handleError(error: Error) {
// do something with the exception
}
}
@NgModule({
providers: [{ provide: ErrorHandler, useClass: CustomErrorHandler }],
})
class AppModule {}
@robertohuertasm
robertohuertasm / errorhandler_ionic.ts
Created December 23, 2018 02:03
never miss error ionic
class CustomErrorHandler implements IonicErrorHandler {
handleError(error: Error) {
// do something with the exception
}
}
@NgModule({
providers: [{ provide: ErrorHandler, useClass: CustomErrorHandler }],
})
class AppModule {}
@robertohuertasm
robertohuertasm / cargo.toml
Created December 23, 2018 02:13
aws-lambda-rust
[package]
name = "aws-lambda-rust"
version = "0.1.0"
authors = ["You <your@email.com>"]
edition = "2018"
autobins = false
[[bin]]
name = "bootstrap"
path = "src/main.rs"
@robertohuertasm
robertohuertasm / main.rs
Created December 23, 2018 02:14
aws-lambda-rust
use lambda_runtime::{error::HandlerError, lambda};
use std::error::Error;
use serde_derive::{Serialize, Deserialize};
// Struct that will hold information of the request.
// When we use an API Gateway as a proxy, which is the default
// behaviour when we create it from the Lambda website, the request
// will have a specific format with many different parameters.
// We're only going to use `queryStringParameters` to check the
// query string parameters (normally for GET requests) and `body`
@robertohuertasm
robertohuertasm / request.json
Created December 23, 2018 02:17
aws-lambda-rust
{
// query string params is an object
"queryStringParameters": {
"firstName": "Roberto"
},
// body always comes as a string
"body": "{ \"firstName\": \"Rob\" }"
}
@robertohuertasm
robertohuertasm / hello.rs
Created December 23, 2018 02:23
azure-function-rust
use azure_functions::func;
use azure_functions::bindings::{HttpRequest, HttpResponse};
use serde_derive::Deserialize;
// Struct that will hold information about the body of the request.
#[derive(Deserialize)]
pub struct Body {
name: String,
}
@robertohuertasm
robertohuertasm / Cargo.toml
Created December 23, 2018 02:23
azure-function-rust
[dependencies]
azure-functions = "0.3.0"
log = "0.4.6"
serde = "1.0.82"
serde_derive = "1.0.82"
serde_json = "1.0.33"