Skip to content

Instantly share code, notes, and snippets.

View masfj's full-sized avatar

m13o masfj

View GitHub Profile
;; to cent
(* 1200.0 (log value 2)) ;; value 0.5 2.0 4.0
;; from cent
(expt 2 (/ cent 1200.0)) ;; cent -1200 0 1200 2400
@masfj
masfj / emacs-build.sh
Created May 28, 2018 16:45
Emacs26.1 build
#!/bin/bash
EMACS_VERSION=26.1
RC_VERSION=-rc1
PATCH_VERSION=6.90
curl -O http://ftp.gnu.org/pub/gnu/emacs/emacs-${EMACS_VERSION}.tar.gz
curl -O ftp://ftp.math.s.chiba-u.ac.jp/emacs/emacs-${EMACS_VERSION}${RC_VERSION}-mac-${PATCH_VERSION}.tar.gz
tar zxvf emacs-${EMACS_VERSION}.tar.gz
(* 20.0 (log10 255)) ;; 8bit
(* 20.0 (log10 65535)) ;; 16bit
(* 20.0 (log10 16777216)) ;; 24bit
(* 20.0 (log10 4294967296)) ;; 32bit
(* 20.0 (log10 18446744073709551616)) ;; 64bit
## /etc/nsswitch.conf
# db_home: cygwin desc
db_home: windows
#include <string>
#include <functional>
#include <vector>
#include <queue>
#include <algorithm>
#include <memory>
#include <iostream>
namespace
{
#include <type_traits>
#include <initializer_list>
#include <iostream>
class enable_class
{
public:
template <typename ... Types, typename std::enable_if_t<sizeof...(Types) == 2, std::nullptr_t> = nullptr>
enable_class(Types... args)
{
@masfj
masfj / spotlight-reload.org
Created August 21, 2017 06:37
Spotlightが/Applications内の.appを正しく表示しなくなった時の対応

ターミナル上で以下のコマンドを叩く

sudo mdutil -a -i off
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist 
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist 
sudo mdutil -a -i on
@masfj
masfj / no_exception_no_rtti.md
Created February 5, 2016 07:58
no 例外 no RTTI

clang++ -fno-exceptions -fno-rtti

@masfj
masfj / provisioningprofile.md
Created January 20, 2016 08:17
importされているProvisioning Profileがあるディレクトリパス

~/Library/MobileDevice/Provisioning Profiles

@masfj
masfj / unique_ptr<CFURLRef>.md
Last active December 12, 2015 03:39
愚直に書くと発狂しそうになるシリーズ
std::unique_ptr<std::remove_pointer<CFURLRef>::type, decltype(&CFRelease)> file(CFURLCreateFromFileSystemRepresentation(nullptr,
                                                                                                                        reinterpret_cast<const unsigned char*>(filename.c_str()),
                                                                                                                        filename.length(),
                                                                                                                        false),
                                                                                CFRelease);