Skip to content

Instantly share code, notes, and snippets.

@dolcalmi
dolcalmi / mock.js
Created April 25, 2023 00:34 — forked from christianhaller3000/mock.js
Mock node dns resolver
jest.mock("dns", () => {
return {
promises: {
Resolver: function() {
return {
resolveTxt: () => {
return ["1.1.1.1","2.2.2.2/28"];
}
};
}
@dolcalmi
dolcalmi / test-custom-fields.md
Last active August 18, 2022 04:17
How to test custom fields

How to test:

Validate custom fields empty schema

If customFields config is empty all related mutations and queries should not be visible by api clients.

You can validate this running make start-main (no changes to schema files)

Add custom schema to default.yaml (example)

@dolcalmi
dolcalmi / install-nodejs-on-raspberrypi-armv6.md
Created June 14, 2021 19:40 — forked from davps/install-nodejs-on-raspberrypi-armv6.md
Steps to install nodejs on Raspberry Pi B+ (armv6)

Steps to install nodejs v6.2 on Raspberry Pi B+ (armv6)

cd ~
wget http://nodejs.org/dist/v6.2.1/node-v6.2.1-linux-armv6l.tar.gz
tar -xzf node-v6.2.1-linux-armv6l.tar.gz
node-v6.2.1-linux-armv6l/bin/node -v

The last command should print v6.2.1.

Now you can copy it to /usr/local

@dolcalmi
dolcalmi / clean.sh
Created July 18, 2020 15:32 — forked from Iman/clean.sh
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@dolcalmi
dolcalmi / stellar-create-account.js
Created July 7, 2019 18:49
Stellar account creation
const StellarSdk = require('stellar-sdk');
const server = new StellarSdk.Server('https://horizon.stellar.org')
const source = StellarSdk.Keypair.fromSecret('SC...CU');
const destination = StellarSdk.Keypair.fromPublicKey('GAD...PZR')
StellarSdk.Network.usePublicNetwork();;
server.accounts()
.accountId(source.publicKey())
@dolcalmi
dolcalmi / parse-transaction.js
Last active January 1, 2019 20:20
Stellar Payment Parser
/*
* parser modified to handle only payments: please check original in https://github.com/orbitlens/stellar-notifier/blob/552b58d976080322abba8833c73567a517c6b250/logic/stream-processor.js
*/
/* eslint-disable no-underscore-dangle */
import { Transaction } from 'stellar-base';
import BigNumber from 'bignumber.js';
const debug = require('debug')('yourproject:stellar:parser');

Keybase proof

I hereby claim:

  • I am dolcalmi on github.
  • I am dolcalmi (https://keybase.io/dolcalmi) on keybase.
  • I have a public key ASA4gp-F14TLoiXhO6XZJ2ZV1y44O4uX-yDH8jp-h43wkwo

To claim this, I am signing this object:

@dolcalmi
dolcalmi / ember_examples.md
Created November 24, 2015 19:49 — forked from rwjblue/ember_examples.md
Ember Examples
#! /usr/bin/env bash
# Variables
APPENV=local
DBHOST=localhost
DBNAME=dbname
DBUSER=dbuser
DBPASSWD=test123
echo -e "\n--- Mkay, installing now... ---\n"
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
box = 'ubuntu/trusty64'
hostname = 'emberclibox'
domain = 'embertest.local'
ip = '192.168.13.100'
ram = '768' # 512 throws an out of memory exception in npm install -g ember-cli