Skip to content

Instantly share code, notes, and snippets.

cjlaborde

Block or report user

Report or block cjlaborde

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cjlaborde
cjlaborde / postgres-cheatsheet.md
Created Nov 16, 2018 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet
View postgres-cheatsheet.md

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)
View schema.rb
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `rails
# db:schema:load`. When creating a new database, `rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
View gist:70cef61e33af3e22cf9143b92c741dc3
<div class="modal fade" id="new_calendar">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button class="close" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body">
<%= form_for [@room, Calendar.new] do |f| %>
<div class="row">
<div class="col-md-6">
View Github Commands
### Checks your account info.
git config --list
### Rename past Commits
1)git rebase --interactive HEAD~2
put reword in front of the commit you want to change name
2) another window again with the title of the commit you wrote reword in front
3) git push --force
View Laravel Commands
php artisan make:model Foo -mcr
### Debug commands
php artisan package:discover
`php artisan route:clear`
`php artisan cache:clear`
`php artisan config:clear`
`php artisan view:clear`
View PHP Commands
### Switch PHP version in Linux.
sudo update-alternatives --config php
### Find php.ini file location
{{ print_r(php_ini_loaded_file()) }}
sudo code /etc/php/7.4/fpm/php.ini --user-data-dir
display_errors = Off"
phpinfo();
@cjlaborde
cjlaborde / gist:794b5d475eeb2689b36de9009646933e
Last active Mar 22, 2020 — forked from yesvods/gist:51af798dd1e7058625f4
Merge Arrays in one with ES6 Array spread
View gist:794b5d475eeb2689b36de9009646933e
const arr1 = [1,2,3]
const arr2 = [4,5,6]
const arr3 = [...arr1, ...arr2] //arr3 ==> [1,2,3,4,5,6]
Short Version
const mergedarray = [].concat(...yourArrays);
View Vue stuff.md

Async calls

<template>
<p v-if="isLoading">
  Loading...
  {{ myData.if.you.try.to.access.properties.here.it.will.error }}
</p>
<p v-else>
  {{ myData.you.can.access.properties.now.that.myData.is.loaded }}
View Vue stuff.md

Async calls

<template>
<p v-if="isLoading">
  Loading...
  {{ myData.if.you.try.to.access.properties.here.it.will.error }}
</p>
<p v-else>
  {{ myData.you.can.access.properties.now.that.myData.is.loaded }}
View Server Setup
### File Limit
https://www.tecmint.com/limit-file-upload-size-in-nginx/
#### Set in http block which affects all server blocks (virtual hosts).
```
http {
...
client_max_body_size 100M;
}
You can’t perform that action at this time.