Skip to content

Instantly share code, notes, and snippets.

View Alexisvt's full-sized avatar
🎯
Focusing

Alexis Villegas Torres Alexisvt

🎯
Focusing
  • San Jose, Costa Rica
View GitHub Profile
@Alexisvt
Alexisvt / go-commands.md
Last active August 17, 2020 01:29
Some useful go commands

List of useful go commands

go help

Display useful information about the different commands available. If we need more information about an specific command, type:

# Where [command] can be any of the available commands
go help [command]
@Alexisvt
Alexisvt / moment-sample.js
Last active July 15, 2020 16:13
Code snippet showing how to transform a regular date to UTC and vice versa.
const moment = require('moment');
const regularDate = moment() // ?
const regularDateString = regularDate.format('YYYY-mm-DD HH:ss'); // ?
const utcDate = moment.utc() // ?
const utcString = utcDate.format('YYYY-mm-DD HH:ss') //?
// transforming regular to UTC
console.log(moment.utc(regularDate).format('YYYY-mm-DD HH:ss')) // ?
@Alexisvt
Alexisvt / mongo.md
Created April 12, 2020 23:12
Mongo DB container setup command

How to run a mongo db container

docker run -it --rm --network backend_default mongo mongo --host mongo -u root -p root --authenticationDatabase admin graphqlserver
@Alexisvt
Alexisvt / jsconfig.json
Created April 10, 2020 02:45
JSConfig file for Node.js projects
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"checkJs": true,
"resolveJsonModule": true,
"esModuleInterop": true,
},
"exclude": ["node_modules"]
}
@Alexisvt
Alexisvt / README.md
Last active March 23, 2020 03:43
Dart intl package cheatsheet

The intl package supports a broad range of date formatting patterns. Here's a list (taken from the official docs):

DAY                          d
 ABBR_WEEKDAY                 E
 WEEKDAY                      EEEE
 ABBR_STANDALONE_MONTH        LLL
 STANDALONE_MONTH             LLLL
 NUM_MONTH                    M
 NUM_MONTH_DAY                Md
@Alexisvt
Alexisvt / Search my gists.md
Created January 23, 2020 11:52 — forked from santisbon/Search my gists.md
How to search gists

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@Alexisvt
Alexisvt / jsconfig.json
Created January 23, 2020 11:51
A configuration file for VSCode to work with Node.js projects
{
"compilerOptions": {
"target": "es2015",
"allowSyntheticDefaultImports": true,
// why set module property https://github.com/Microsoft/vscode/issues/73118#issuecomment-488252519
"module": "commonjs",
"checkJs": true
},
"exclude": ["node_modules"]
}
@Alexisvt
Alexisvt / readme.md
Last active January 9, 2020 19:44
Angular Universal Cheatsheet

General commands

How to add SSR support to any existing Angular App

The next command will add the neccesary logic to activate the SRR feature on any Angular app.

npx ng generate universal --client-project your-project-name 
@Alexisvt
Alexisvt / git-stash.md
Last active December 26, 2019 02:21 — forked from curtismckee/git-stash.md
Git Stash Cheatsheet

git stash list

  • Lists all stashes on stack.

git stash push -m "message"

  • Stash changes, where "message" is your note for that stash.

git stash apply stash@{0}

  • Applies the changes from stash but does not delete from stack.