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 / README.md
Created October 14, 2018 22:30
How to add path aliases to Nest.js

README FIRST

In order to accomplish this we need to install the next package to our project:

> install module-alias --save

Then we need to modify three files, lets go in order:

@Alexisvt
Alexisvt / nodejs-custom-es6-errors.md
Created July 23, 2018 01:08 — forked from slavafomin/nodejs-custom-es6-errors.md
Custom ES6 errors in Node.js

Here's how you could create custom error classes in Node.js using latest ES6 / ES2015 syntax.

I've tried to make it as lean and unobtrusive as possible.

Defining our own base class for errors

errors/AppError.js

@Alexisvt
Alexisvt / whatsnew.dart
Created July 3, 2018 14:41 — forked from rodydavis/whatsnew.dart
Drop in file for flutter to show a whats new page for the user that is native for android and iOS. (Similar to apples version in keynote, pages, app store and other apps)
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'dart:io';
import 'dart:async';
//Example
class StartPage extends StatelessWidget {
// SHow Native Pop Up to User
static Future<Null> showAlertPopup(
BuildContext context, String title, String detail) async {
@Alexisvt
Alexisvt / cloudSettings
Last active July 15, 2020 23:38
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-07-15T23:38:36.791Z","extensionVersion":"v3.4.3"}
@Alexisvt
Alexisvt / branch-management.md
Last active March 9, 2023 16:54
Git commands for branch's managment

Branch Management

How to create a branch

git branch my-branch

How to move to a branch

@Alexisvt
Alexisvt / ImagePicker.js
Created April 30, 2018 14:46 — forked from pvanliefland/ImagePicker.js
react-native-image-picker (workarounds)
import {Platform, PermissionsAndroid} from 'react-native';
import RNImagePicker from 'react-native-image-picker';
/**
* Overrides react-native-image-picker
*
* Attempts to fix:
*
* - https://github.com/react-community/react-native-image-picker/issues/385
* - https://github.com/react-community/react-native-image-picker/issues/581
@Alexisvt
Alexisvt / grant.sql
Created April 25, 2018 16:54
Grant EXECUTE to user for ALL stored procedures (existing & new) in a schema
GRANT EXECUTE ON schema::<schema name> TO <user name>
@Alexisvt
Alexisvt / role.sql
Last active April 13, 2018 16:11
SQL query for create a sql user for the database
-- This file should execute in the database that you want to assign this user
CREATE USER webappuser
FOR LOGIN webappuser
GO
EXEC sp_addrolemember N'db_datareader', N'webappuser'
EXEC sp_addrolemember N'db_datawriter', N'webappuser'
EXEC sp_addrolemember N'db_ddladmin', N'webappuser'
GO
@Alexisvt
Alexisvt / jsconfig.json
Created March 28, 2018 05:46
VSCode jsconfig file for React Native App
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"allowSyntheticDefaultImports": true,
"checkJs": true,
"jsx": "react-native"
},
"exclude": ["node_modules"]
}
@Alexisvt
Alexisvt / timeConvert.js
Last active March 23, 2018 20:35
function that converts minutes to days, hours and minutes in javascript
function timeConvert(minutes) {
return `${Math.floor(minutes / 24 / 60)}:${Math.floor((minutes / 60) % 24)}:${Math.floor(minutes % 60)}`;
}