Skip to content

Instantly share code, notes, and snippets.

View lvidarte's full-sized avatar

Leo Vidarte lvidarte

View GitHub Profile
@lvidarte
lvidarte / postgres-cheatsheet.md
Created November 19, 2017 10:34 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@lvidarte
lvidarte / linux_fun.md
Last active November 6, 2017 13:45 — forked from marianposaceanu/linux_fun.md
How to have some fun using the terminal.

Linux fun-o-matic

How to have some fun using the terminal.

  1. Install cowsay [0] via : sudo apt-get install cowsay
  2. Install fortune [1] via : sudo apt-get install fortune
  3. Make sure you have Ruby installed via : ruby -v
  4. Install the lolcat [2] via : gem gem install lolcat
  5. Profit!
@lvidarte
lvidarte / gist:14864e94c857fb3bc0eca805d977ec8d
Created September 3, 2017 12:10 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@lvidarte
lvidarte / index.html
Last active December 18, 2015 21:43 — forked from anonymous/index.html
Angular providers
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<meta charset="utf-8">
</head>
<body ng-app="app">
<div ng-controller="ctrl">
Score: {{ score.points }}
@lvidarte
lvidarte / index.html
Last active December 18, 2015 18:54 — forked from anonymous/index.html
$scope.$watch function
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<meta charset="utf-8">
</head>
<body ng-app="app">
<div ng-controller="SumController">
<select ng-model="value" ng-options="n for n in [1, 2, 3, 4, 5]"></select>
@lvidarte
lvidarte / index.html
Last active December 18, 2015 18:54 — forked from anonymous/index.html
Angular $scope inheritance
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<meta charset="utf-8">
</head>
<body ng-app="app">
<div ng-controller="NameController">
{{ name }}