Skip to content

Instantly share code, notes, and snippets.

View kathgironpe's full-sized avatar

Katherine Giron Pe kathgironpe

  • SEA
  • 14:46 (UTC +08:00)
View GitHub Profile
@kathgironpe
kathgironpe / eslint_prettier_airbnb.md
Created July 6, 2022 04:54 — forked from bradtraversy/eslint_prettier_airbnb.md
ESLint, Prettier & Airbnb Setup

VSCode - ESLint, Prettier & Airbnb Setup

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
@kathgironpe
kathgironpe / code_completion_macvim.md
Last active August 18, 2022 05:15
Code Completion for MacVim

Code Completion for MacVim

Notes

I have deleted Neocomplete.vim and all references so I no longer get any warning while using Vim.

I have tried COC and new faster versions of COC and they all do not work with Vim 8.2+. Other options were too slow, but they are more widely used.

Python

@kathgironpe
kathgironpe / vim_python.md
Last active June 10, 2022 01:56
Vim and Python linters

PEP 8 and Vim

brew install flake8

With syntastic, define the linter:

let g:syntastic_check_on_open = 1
@kathgironpe
kathgironpe / unfollow.js
Created July 20, 2021 11:08 — forked from JamieMason/unfollow.js.md
Unfollow everyone on twitter.com
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//
// 1. Go to https://twitter.com/YOUR_USER_NAME/following
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac)
// 3. Paste this into the Developer Console and run it
//
// See this tweet by @jacknotlittle for a video showing you how to do it;
// https://twitter.com/jacknotlittle/status/1387471283525459969
//
@kathgironpe
kathgironpe / clamav-mac.md
Created July 23, 2019 15:06 — forked from Uchean/clamav-mac.md
Get ClamAV running on Mac OS X (using Homebrew)

Get ClamAV running on Mac OS X (using Homebrew)

The easiest way to get the ClamAV package is using Homebrew

$ brew install clamav

Before trying to start the clamd process, you'll need a copy of the ClamAV databases.

Create a freshclam.conf file and configure as so

@kathgironpe
kathgironpe / k2pdfopt.md
Created June 14, 2019 15:05 — forked from returnwellbeing/k2pdfopt.md
pdf 문서를 킨들에 넣는 방법
@kathgironpe
kathgironpe / rails-jsonb-queries
Created February 14, 2019 09:29 — forked from mankind/rails-jsonb-queries
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")
@kathgironpe
kathgironpe / Guardian JWT.md
Last active January 14, 2024 12:35 — forked from nikneroz/Guardian JWT.md
Elixir + Phoenix Framework + Guardian + JWT. This is tutorial and step by step installation guide.

Elixir + Phoenix Framework + Guardian + JWT + Comeonin

Preparing environment

We need to generate secret key for development environment.

mix phx.gen.secret
# ednkXywWll1d2svDEpbA39R5kfkc9l96j0+u7A8MgKM+pbwbeDsuYB8MP2WUW1hf

Let's generate User model and controller.

@kathgironpe
kathgironpe / WebSockets.md
Created November 16, 2018 04:16 — forked from subudeepak/WebSockets.md
The problems and some security implications of websockets - Cross-site WebSockets Scripting (XSWS)

WebSockets - An Introduction

WebSockets is a modern HTML5 standard which makes communication between client and server a lot more simpler than ever. We are all familiar with the technology of sockets. Sockets have been fundamental to network communication for a long time but usually the communication over the browser has been restricted. The general restrictions

  • The server used to have a permanent listener while the client (aka browser) was not designated any fixed listener for a more long term connection. Hence, every communication was restricted to the client demanding and the server responding.
  • This meant that unless the client requested for a particular resource, the server was unable to push such a resource to the client.
  • This was detrimental since the client is then forced to check with the server at regular intervals. This meant a lot of libraries focused on optimizing asynchronous calls and identifying the response of asynchronous calls. Notably t
@kathgironpe
kathgironpe / phx-1.4-upgrade.md
Created November 15, 2018 11:38 — forked from chrismccord/phx-1.4-upgrade.md
Phoenix 1.3.x to 1.4.0 Upgrade Guides

Phoenix 1.4 ships with exciting new features, most notably with HTTP2 support, improved development experience with faster compile times, new error pages, and local SSL certificate generation. Additionally, our channel layer internals receiveced an overhaul, provided better structure and extensibility. We also shipped a new and improved Presence javascript API, as well as Elixir formatter integration for our routing and test DSLs.

This release requires few user-facing changes and should be a fast upgrade for those on Phoenix 1.3.x.

Install the new phx.new project generator

The mix phx.new archive can now be installed via hex, for a simpler, versioned installation experience.

To grab the new archive, simply run: