Skip to content

Instantly share code, notes, and snippets.

View Javieratapiab's full-sized avatar
🦊

Javiera Tapia Javieratapiab

🦊
  • GitLab
  • Santiago, Chile
View GitHub Profile
@Javieratapiab
Javieratapiab / iterm2.md
Created February 12, 2022 16:09 — forked from squarism/iterm2.md
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@Javieratapiab
Javieratapiab / rails-jsonb-queries
Created November 10, 2021 23:55 — forked from mankind/rails-jsonb-queries
Ruby on Rails-5 postgresql-9.6 jsonb queries
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")
@Javieratapiab
Javieratapiab / rails_new_options_help.md
Created July 11, 2021 05:24 — forked from kirillshevch/rails_new_options_help.md
List of "rails new" options to generate a new Rails 6 application

Run rails new --help to view all of the options you can use to generate new Rails application:

Output for Rails 6+

Usage:
  rails new APP_PATH [options]

Options:
      [--skip-namespace], [--no-skip-namespace]              # Skip namespace (affects only isolated applications)
package project;
class MiClase4<T> {
// Atributos
private T attr1;
// Constructor
public MiClase4(T attr1) {
this.attr1 = attr1;
}
@Javieratapiab
Javieratapiab / postgres-brew.md
Created November 14, 2020 03:36 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@Javieratapiab
Javieratapiab / racket-cheetsheet.rkt
Last active October 20, 2020 23:56
Racket cheet sheet
; Aspectos imperativos
; IF CONDICION CASO_VERDADERO CASO_FALSO
(if (>= 3 0) "positivo" "negativo")
; => positivo
; Etiquetando una función
(define sucesor (lambda (n) (+ n 1)))
; Composición de funciones en Scheme
(define f (lambda (x) (* x 2)))
@Javieratapiab
Javieratapiab / elapsed-time-ruby.rb
Created March 29, 2020 04:52
Correct elapsed time Ruby
### THE WRONG WAY ###
starting = Time.now
# time consuming operation
ending = Time.now
elapsed = ending - starting
elapsed # => 10.822178
#####################
### THE GOOD WAY ###
starting = Process.clock_gettime(Process::CLOCK_MONOTONIC)
@Javieratapiab
Javieratapiab / README-Template.md
Created August 6, 2018 02:59 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@Javieratapiab
Javieratapiab / postgres-cheatsheet.md
Created July 18, 2018 16:14 — 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)