Skip to content

Instantly share code, notes, and snippets.

View notakaos's full-sized avatar

Nobutaka OSHIRO notakaos

View GitHub Profile
@notakaos
notakaos / mold-macos.patch
Created March 10, 2022 03:09
mold(v1.1.1): fix read_symlink("/proc/self/exe") error in macOS
diff --git a/elf/lto.cc b/elf/lto.cc
index 30060ed4..38f9aa17 100644
--- a/elf/lto.cc
+++ b/elf/lto.cc
@@ -88,6 +88,11 @@
#include <sstream>
#include <unistd.h>
+#if defined(__APPLE__) && defined(__MACH__)
+#include <sys/param.h>
@notakaos
notakaos / create_function_plv8_cuid.sql
Last active May 1, 2024 20:45
cuid for PostgreSQL with PL/v8
-- original code: https://github.com/ericelliott/cuid
-- Add the "plv8" extension
create extension if not exists "plv8";
-- Add the "pgcrypto" extension
create extension if not exists "pgcrypto";
\dx
-- Connect a database
@notakaos
notakaos / pbcc
Last active July 30, 2017 06:26
pbcc - [Bash] Copy last command to clipboard (for macOS)
# ~/.bash_profile
### Copy last command to clipboard
function pbcc() {
local HISTIGNORE=*
history -p \!\! | pbcopy
history -d $(history | awk '{a=$1}END{print $1}')
}
@notakaos
notakaos / bash
Last active January 16, 2017 07:50
Install-php54-with-phpbrew-on-macOS
$ brew install pbzip2 openssl
$ xcode-select --install
$ phpbrew install 5.4.45 +default +openssl=$(brew --prefix openssl) +bz2=$(brew --prefix pbzip2)
#!/bin/bash
cat ~/.ssh/conf.d/config ~/.ssh/conf.d/*.conf > ~/.ssh/config
@notakaos
notakaos / .bash_profile
Created November 2, 2016 02:39
Change bash prompt (for Mac)
# export PROMPT="\[\e[0;32m\]$PS1\[\e[m\]"
# export PROMPT="\[\e[0;33m\][\u@\H:\w]\[\e[m\] \n\[\e[0;32m\]\$\[\e[m\] "
# export PROMPT="\[\e[0;33m\][\u@\H:\w]\[\e[m\] \n\[\e[0;32m\]$(echo -en '\U1F363') \[\e[m\] "
# export PROMPT="\[\e[0;33m\][\u@\H:\w]\[\e[m\] \n\[\e[0;32m\]$(echo -en '(´・Д・)')\[\e[m\] "
# ref. http://stackoverflow.com/questions/16715103/bash-prompt-with-last-exit-code
function __prompt_command() {
local EXIT="$?"
local ColRed='\[\e[0;31m\]'
@notakaos
notakaos / .eslintrc
Created March 26, 2016 06:10
esintrc for Meteor
{
"parser": "babel-eslint",
"extends": "airbnb",
"globals": {
"Meteor": false,
"Tracker": false,
"Session": false,
"Template": false,
"Random": false,
@notakaos
notakaos / bash
Created March 25, 2016 19:20
Meteor 1.3 + React Simple Memo Step 8-1
meteor remove insecure
meteor add aldeed:simple-schema
@notakaos
notakaos / bash
Created March 25, 2016 18:43
Meteor 1.3 + React Simple Memo Step 7-2
meteor npm install --save react-masonry-component
@notakaos
notakaos / bash
Created March 25, 2016 18:29
Meteor 1.3 + React Simple Memo Step 7-1
meteor npm install --save react-textarea-autosize