Skip to content

Instantly share code, notes, and snippets.

View daniel-vera-g's full-sized avatar
💭
Present

Daniel VG daniel-vera-g

💭
Present
View GitHub Profile
@daniel-vera-g
daniel-vera-g / asyncJs.js
Created January 20, 2018 06:43
Asynchronous Javascript
/*
Different Methods to make code work the sync-way:
1. Callbacks
- Problem --> Callback hell
2. Promises
- Problem --> Not DRY-Method comfortable
3. Async/Await
*/
/* Examples:

Keybase proof

I hereby claim:

  • I am daniel-vera-g on github.
  • I am dvg (https://keybase.io/dvg) on keybase.
  • I have a public key whose fingerprint is 6801 C794 C170 906E C260 8F40 CEBB D7D1 3F1E 01E3

To claim this, I am signing this object:

@daniel-vera-g
daniel-vera-g / update-lnd.txt
Last active May 10, 2019 19:20
Update LND to v0.6
# Release at: https://github.com/lightningnetwork/lnd/releases/tag/v0.6-beta
# Stop lnd service
sudo systemctl stop lnd
cd /home/admin/download
# Get all required release files
wget https://github.com/lightningnetwork/lnd/releases/download/v0.6-beta/lnd-linux-armv7-v0.6-beta.tar.gz
@daniel-vera-g
daniel-vera-g / .zshrc
Created April 19, 2019 11:46
zsh shell config for windows
# Path to your dotfiles installation.
export DOTFILES=$HOME/.dotfiles
ZSH_DISABLE_COMPFIX=true
# CONFIG FOR Hyper
# IF BABUN use THIS
# export HOME="/cygdrive/c/Users/danielVg/"
@daniel-vera-g
daniel-vera-g / .hyper
Created April 19, 2019 11:52
Hyper terminal config for windows and linux
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
windowSize: [1000, 500],
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: "stable",
@daniel-vera-g
daniel-vera-g / flutter_starter.dart
Created May 16, 2019 18:15
Heavily documented flutter starter app boilerplate.
import 'package:flutter/material.dart';
import 'package:english_words/english_words.dart';
// Arrow functions for one line functions
void main() => runApp(MyApp());
// Makes App itself widget -> Nearly everything is widget(alignment, padding & layout)
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@daniel-vera-g
daniel-vera-g / c-pointer-fun.c
Last active April 10, 2020 19:48
c pointers explained.
#include <stdio.h>
int main() {
int* p;
// Address pointer is pointing to
printf("Address pointer p is pointing to: %p\n", p);
// Address of pointer itself
printf("Address of pointer p itself: %p\n", &p);
int x = 3;
@daniel-vera-g
daniel-vera-g / update-markdown-toc.sh
Created October 25, 2020 14:36
Update Markdown table of contents using markdown-toc npm package and linux utilities
#!/bin/sh
# Remove current toc:
# 1. Use sed to remove everything till the first heading
# 2. Write it to tmp file
# 3. When no errors merge it with index file
sed -n '/^#/,$p' index.md > tmp \
&& yes | mv tmp index.md
# Create table of contents:

Commit messages

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

<type>(<scope>): <subject>
<BLANK LINE>

Project Title

One Paragraph of project description goes here

Usage

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites (Optional)