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 / cloudSettings
Last active July 9, 2018 03:54
Visual Studio Code Sync Settings GIST
{"lastUpload":"2018-07-09T03:53:18.280Z","extensionVersion":"v2.9.2"}
@Alexisvt
Alexisvt / cascade.js
Created January 9, 2018 12:08 — forked from zbarbuto/cascade.js
Loopback cascade mixin gist
// Cascade delete for loopback
// https://gist.github.com/CjS77/44b2f75c0ec468f590d0
/* jshint node:true */
'use strict';
/**
* There is an incubating feature to cascade the deletes to the relational tables. see
* https://github.com/strongloop/loopback-datasource-juggler/issues/88
*/
@Alexisvt
Alexisvt / tslint.json
Created February 8, 2018 21:00
Sample tslint.json file for angular projects
{
"defaultSeverity": "error",
"extends": ["tslint:recommended"],
"jsRules": {},
"rules": {
"quotemark": [true, "single"],
"trailing-comma": [false],
"only-arrow-functions": [false],
"no-console": [false],
"ordered-imports": [false],
@Alexisvt
Alexisvt / git-remove-all-DS_Store
Created February 19, 2018 21:54 — forked from brianmriley/git-remove-all-DS_Store
How Can I Remove .DS_Store Files From A Git Repository? Open terminal and run the following command from your git project root. http://stackoverflow.com/questions/107701/how-can-i-remove-ds-store-files-from-a-git-repository
find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch
@Alexisvt
Alexisvt / .bash_profile
Created February 26, 2018 21:00 — forked from mocon/.bash_profile
Example `.bash_profile` file
# Edit this file
alias aliases="nano ~/.bash_profile" # usage: type `aliases` in Terminal
# Navigate to location
alias home="cd ~"
alias desktop="cd ~/Desktop/"
alias repos="cd ~/Documents/Repos/"
# Navigate to project directory
alias ds="clear && cd ~/Documents/Repos/design-system"
@Alexisvt
Alexisvt / Mac OS X: Open in Visual Studio Code
Created February 27, 2018 02:03 — forked from tonysneed/Mac OS X: Open in Visual Studio Code
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"
@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)}`;
}
@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 / 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 / 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>