Skip to content

Instantly share code, notes, and snippets.

View Rukomoynikov's full-sized avatar
🏠
Working from home

Max Rukomoynikov Rukomoynikov

🏠
Working from home
View GitHub Profile
@RISCfuture
RISCfuture / typescript-vue.md
Last active June 3, 2023 05:48
Adding TypeScript to a Rails + Webpacker + Vue project

Adding TypeScript to a Rails + Webpacker + Vue project

These instructions assume you already have a Rails 5.2 project using Webpacker 4 with Vue 2 and Vuex 3. I'll show you how to add TypeScript to the project, and type-safe your Vue components, including single-file components (SFCs). This document will not teach you TypeScript syntax or type theory. It also assumes your code already works without TypeScript. You shouldn't use this article to, for example, get started with Vuex, because I'm leaving out lots of necessary boilerplate code and focusing just on TypeScript changes.

If you want to see a commit on a project accomplishing this migration, visit https://github.com/RISCfuture/AvFacts/commit/666a02e58b4626a074a03812ccdd193a3891a954.

Setup

  1. Run rails webpacker:install:typescript. This should modify config/webpacker.yml and config/webpack/environment.js (leave those changes), add tsconfig.json and config/webpack/loaders/typescript.js (leave those files), and add some other files in `a
@mikoscz
mikoscz / elixir_with_asdf_mac.md
Last active October 25, 2021 12:56
Install elixir with asdf-vm mac os
  1. brew install asdf
echo -e '\n. $(brew --prefix asdf)/asdf.sh' >> ~/.zshrc
echo -e '\n. $(brew --prefix asdf)/etc/bash_completion.d/asdf.bash' >> ~/.zshrc
brew install \
 coreutils automake autoconf openssl \
@janko
janko / results
Last active December 14, 2022 09:15
MiniMagick vs libvips benchmark (generating a 500x500 thumbnail)
width, imagemagick, libvips
1000, 0.129, 0.045
1500, 0.190, 0.067
2000, 0.276, 0.054
2500, 0.380, 0.068
3000, 0.498, 0.085
@niraj-shah
niraj-shah / parse_acl.js
Created August 2, 2013 17:44
Two examples of setting ACL controls using Parse JS SDK
// ACL to restrict write to user, and public read access
var custom_acl = new Parse.ACL();
// give write access to the current user
custom_acl.setWriteAccess( Parse.User.current(), true);
// give public read access
custom_acl.setPublicReadAccess(true);
GameObject.setACL(custom_acl);
// ACL to restrict write to user, and no public access
var custom_acl = new Parse.ACL();