Skip to content

Instantly share code, notes, and snippets.

View asbish's full-sized avatar
🎨
willing suspension of disbelief

Yu Ishii asbish

🎨
willing suspension of disbelief
View GitHub Profile
@asbish
asbish / init.el
Created February 16, 2021 14:45
prettier-restart
(require 'package)
(setq package-archives
'(("melpa" . "https://melpa.org/packages/")))
(package-initialize)
(package-refresh-contents)
(package-install 'use-package)
(package-install 'iter2)
(package-install 'nvm)
(package-install 'markdown-mode)
@asbish
asbish / Setup GCC and CLANG Toolchains.md
Created August 29, 2020 20:06 — forked from bhaskarvk/Setup GCC and CLANG Toolchains.md
Proper GCC (vers. 5/6/7) & LLVM/CLANG (vers. 4/5) Toolchain Setup on Ubuntu/Linux Mint

This approach uses update-alternatives to manage GCC and LLVM/CLANG C/C++ compiler toolchains. Although tested on Linux Mint 18.3, this approach should work on any Debian based distro or for that matter any Linux distro with update-alternatives support, provided the packages are installed correctly.

There are 3 files

  • gcc-alternatives.sh installs GCC versions 5/6/7 and sets up alternatives for gcc/g++/cpp/gfortran.
  • llvm-clang-alternatives.sh installs LLVM and CLANG versions 4/5 and sets up alternatives for various LLVM and CLANG programs including clang and clang++.
  • cc-alternatives.sh sets up alternatives for the cc, cxx, and the ld commands. This script can be used to change systemwide default compiler/linker combination to either GCC or CLANG.

Once these scripts are run you can change the system GCC/CLANG versions by running sudo update-alternatives --config gcc|clang. To change the default compiler/linker combo used by t

@asbish
asbish / .gitignore
Last active December 9, 2019 14:17
unlambda - ehime.rb
*.unl
'use strict';
function typeOf(x) {
const type = typeof x;
if (type === 'object') {
return Array.isArray(x) ? 'array' : 'object';
}
return type;
}
#!/bin/bash
set -ex
DIR=
NEWDIR=${DIR}"-new"
mkdir -p ${NEWDIR}
for f in ${DIR}/*.md
@asbish
asbish / hakyll-default-metavalue.hs
Created January 29, 2016 19:43
Hakyll defalut metavalue
defaultMetaValueCtx :: String -> String -> Context String
defaultMetaValueCtx key defValue = field key (defaultMetaValue key defValue)
defaultMetaValue :: String -> String -> Item a -> Compiler String
defaultMetaValue key defValue item = do
let ident = itemIdentifier item
let prefix = generatePrefix $ toFilePath ident -- If necessary
value <- getMetadataField ident key
func value prefix
where func val pfx = case val of