Skip to content

Instantly share code, notes, and snippets.

View jaime-ez's full-sized avatar

jaime echegaray zipper jaime-ez

  • Santiago, Chile
View GitHub Profile
'use strict'
const { Connector } = require('@deepstream/storage-postgres')
const async = require('async')
// the connection data for the original database
const postgresOptionsFrom = {
user: '',
database: '',
password: '',
@jaime-ez
jaime-ez / postgres-cheatsheet.md
Last active October 27, 2020 23:23 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -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)
@jaime-ez
jaime-ez / linux-tips.md
Last active March 1, 2017 13:47
Some linux tips

Linux tips

Setting permanent user environment variables

source: http://unix.stackexchange.com/questions/21598/how-do-i-set-a-user-environment-variable-permanently-not-session

local

If you are using bash, ash, ksh or some other Bourne-style shell, you can add ABC="123"; export ABC in your .profile file (${HOME}/.profile). This is the default situation on most unix installations, and in particular on Debian.
If your login shell is bash, you can use .bash_profile (${HOME}/.bash_profile) or .bash_login instead.

#!/bin/bash
#set locale as en_US.UTF-8
export LC_ALL="en_US.UTF-8"
locale-gen
#update
apt-get update && sudo apt-get -y upgrade
#git
@jaime-ez
jaime-ez / payments.md
Last active March 1, 2017 11:45
List of current crypto / payment channels projects
@jaime-ez
jaime-ez / setup.sh
Last active March 1, 2017 11:43
Set up a new Debian server on GCE with git and nvm (setting locale is needed)
#!/bin/bash
# usage: curl gist_raw_url > setup.sh && . setup.sh
#set locale as en_US.UTF-8
sudo export LC_ALL="en_US.UTF-8"
sudo locale-gen
#update
sudo apt-get update && sudo apt-get -y upgrade
@jaime-ez
jaime-ez / postgresqlSetup.md
Last active January 27, 2020 21:17
Setup postgresql on Linux

Setting up Postgresql on a new Debian8 instance

Install necessary packages

# run as root
root$ apt-get update && apt-get upgrade
root$ echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" >> /etc/apt/sources.list
root$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
root$ apt-get update -y
@jaime-ez
jaime-ez / electronAndYeoman.md
Last active February 21, 2017 13:36
building electron apps based on yeoman generator-angular
  • for ngRouter to work links must be in the form <li><a ng-href="#!/about">About</a></li>
  • make a symlink from app/bower_components to ./bower_components (done as Grunt task)
  • use https://github.com/jaime-ez/elemon.git for livereload
  • trick to load modules in index.html (http://stackoverflow.com/questions/32621988/electron-jquery-is-not-defined)
  • add electron as devDependencies, copy package.json and node_modules into dist folder (done as grunt task) and there call electron-packager
  • package.json must include every module called from main.js (whether used for dev purposes or not) and must include the field main pointing to the main entry file for electron (main.js)
<div class="input-group">
<div class="input-group-btn">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{colombiaIdType}} <span class="caret"></span></button>
<ul class="dropdown-menu">
<li ng-show="colombiaIdType !== 'NIT'"><a href="" ng-click="colombiaIdType = 'NIT'">NIT</a></li>
<li ng-show="colombiaIdType !== 'CE'"><a href="" ng-click="colombiaIdType = 'CE'">CE</a></li>
<li ng-show="colombiaIdType !== 'CC'"><a href="" ng-click="colombiaIdType = 'CC'">CC</a></li>
</ul>
</div>
<input type="text" class="form-control" ng-model="destinationOpts.bankAccountHolderId" placeholder="Número de identidad del destinatario" required validate-id-colombia>