A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.
posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord
# this file contains keys needed for decryption of file system data (WUD/WUX) | |
# 1 key per line, any text after a '#' character is considered a comment | |
# the emulator will automatically pick the right key | |
541b9889519b27d363cd21604b97c67a # example key (can be deleted) | |
d7b00402659ba2abd2cb0db27fa2b656 # Common | |
805e6285cd487de0faffaa65a6985e17 # Espresso Ancast | |
b5d8ab06ed7f6cfc529f2ce1b4ea32fd # Starbuck Ancast | |
9a164ee15ac7ceb64d3cc130094095f6 # 007 Legends [EUR, NUS] |
This is a collection of the tweaks and modification I've made to my Arch Linux installation over the months. These may be applicable to other distros, but please check first before doing anything. I also included Arch Wiki references for all the procedures I mentioned. My recommendation is not to blindly follow this gist but to always check with the Arch Linux wiki first. Things move fast and by the time you're reading this my gist may be out of date. Lastly, the golden rule: never execute a command you don't understand.
My current DE of choice is KDE's Plasma. I find it just about perfect.
There are various ways to install it on Arch. The most popular one is to install plasma
and plasma-applications
, but I don't like doing that because it comes with too many programs I'll never use. I, instead, install the base plasma
group, remove the few extra packages that come with it, then I finish off by installing a few KDE apps that don't come with th
#!/usr/bin/env bash | |
# Enable networkd and resolved | |
systemctl enable systemd-networkd | |
systemctl enable systemd-resolved | |
systemctl restart systemd-networkd | |
systemctl restart systemd-resolved | |
# Init pacman mirror | |
curl -s -L "https://www.archlinux.org/mirrorlist/?country=TH&country=SG&country=IN&country=JP&protocol=https&ip_version=4" | sed -e 's/^#Server/Server/' -e '/^#/d' > /etc/pacman.d/mirrorlist |
More recent resolution: | |
1. cd ~/../../etc (go to etc folder in WSL). | |
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line). | |
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line). | |
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian). | |
5. cd ~/../../etc (go to etc folder in WSL). | |
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file). | |
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and | |
secondary. |
THIS GIST IS EXTREMELY OBSOLETE. DO NOT FOLLOW THESE INSTRUCTIONS. SERIOUSLY.
IF YOU IGNORE THE ABOVE WARNING, YOU AGREE IN ADVANCE THAT YOU DIDN'T GET THESE INSTRUCTIONS FROM ME, THAT I WARNED YOU, AND THAT I RESERVE THE RIGHT TO POINT AND LAUGH MOCKINGLY IF AND WHEN SOMETHING BREAKS HORRIBLY.
I'll do a write-up of current custom-kernel procedures over on Random Bytes ( https://randombytes.substack.com/ ) one day soon.
#!/usr/bin/env bash | |
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error | |
# Make sure that the .gnupg directory and its contents is accessibile by your user. | |
chown -R $(whoami) ~/.gnupg/ | |
# Also correct the permissions and access rights on the directory | |
chmod 600 ~/.gnupg/* | |
chmod 700 ~/.gnupg |
# app/models/concerns/serializable.rb | |
# https://codeburst.io/json-serialized-columns-with-rails-a610a410fcdf | |
module Serializable | |
extend ActiveSupport::Concern | |
def initialize(json) | |
if json.is_a?(String) | |
json = begin | |
JSON.parse(json) | |
rescue JSON::ParserError, TypeError | |
return |
The Scroll Behavior specification has been introduced as an extension of the Window
interface to allow for the developer to opt in to native smooth scrolling. To date this has only been implemented in Chrome, Firefox and Opera.
There's a complete polyfill here (3.3KB minified). But most of the times, the following is enough for me (641 bytes minified):
smooth-scrolling-poyfill.js
Use as: scrollToElem('#elem-selector');
function! myspacevim#before() abort | |
" let g:neomake_enabled_c_makers = ['clang'] | |
" nnoremap jk <Esc> | |
endfunction | |
function! myspacevim#after() abort | |
" let g:ale_fixers = { | |
" \ 'javascript': [ | |
" \ 'eslint', | |
" \ 'prettier', |