This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- refs: https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/ReadandWriteFiles.html | |
-- refs: https://medium.com/macoclock/how-in-the-bleep-do-i-mute-my-mic-anywhere-on-macos-d2fa1185b13 | |
on writeTextToFile(theText, theFile, overwriteExistingContent) | |
try | |
set theFile to theFile as string | |
set theOpenedFile to open for access file theFile with write permission | |
if overwriteExistingContent is true then set eof of theOpenedFile to 0 | |
write theText to theOpenedFile starting at eof | |
close access theOpenedFile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
# refs: https://app.vagrantup.com/fedora | |
config.vm.box = "fedora/33-cloud-base" | |
config.vm.provider "virtualbox" do |v| | |
v.memory = 2048 | |
v.cpus = 2 | |
end | |
# https://www.vagrantup.com/docs/synced-folders/nfs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# prefix | |
set -g prefix C-q | |
unbind C-b | |
# keystroke delay | |
set -sg escape-time 1 | |
# to reload | |
bind r source-file ~/.tmux.conf \; display "Reloaded!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CFLAGS=-fPIC ./configure \ | |
--with-tlib=ncurses \ | |
--with-features=huge \ | |
--with-x \ | |
--enable-multibyte \ | |
--enable-luainterp=dynamic \ | |
--enable-gpm \ | |
--enable-cscope \ | |
--enable-fontset \ | |
--enable-fail-if-missing \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./configure \ | |
--prefix=$HOME/local \ | |
--enable-multibyte \ | |
--enable-nls \ | |
--enable-perlinterp \ | |
--enable-pythoninterp=dynamic \ | |
--enable-python3interp=dynamic \ | |
--enable-rubyinterp \ | |
--enable-luainterp --with-lua-prefix=/usr/local \ | |
--enable-cscope \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export EDITOR='vim' | |
export VISUAL='vim' | |
export PAGER='less' | |
# for `Ctrl + w` | |
export WORDCHARS='*?_.[]~-=&;!#$%^(){}<>' | |
export DIRSTACKSIZE=8 | |
bindkey -e | |
setopt clobber |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install \ | |
lua5.2 \ | |
liblua5.2-dev \ | |
luajit \ | |
ruby-dev \ | |
xorg-dev \ | |
libncurses5-dev | |
./configure \ | |
--with-features=huge \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LitElement, html, unsafeCSS } from 'lit-element'; | |
import style from './scss/style.scss'; | |
@customElement('some-component') | |
export default class SomeComponent extends LitElement { | |
static get styles() { | |
return [ | |
// If you don't need to consider IE, you can use a link tag to include style in the render function. | |
unsafeCSS(style), | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// Write me in the head tag. | |
// For this sample, you need to put `@webcomponents/webcomponentsjs/` dirctory from the node_modules into `your-doc-root/js/` dirctory. | |
(function() { | |
if (('customElements' in window)) { | |
document.write('<script defer type="text/javascript" src="/js/main.js"><\/script>'); | |
} else { | |
document.write('<script defer type="text/javascript" src="/js/@webcomponents/webcomponentsjs/webcomponents-loader.js"><\/script>'); | |
window.WebComponents = window.WebComponents || {}; | |
window.WebComponents.root = '/js/@webcomponents/webcomponentsjs/'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function calcOffset(elm: HTMLElement) { | |
const offset = { | |
top: 0, | |
left: 0, | |
} | |
do { | |
offset.top += elm.offsetTop || 0; | |
offset.left += elm.offsetLeft || 0; | |
} while((elm = elm.offsetParent as HTMLElement)); |
NewerOlder