Skip to content

Instantly share code, notes, and snippets.

View Nyoho's full-sized avatar
:octocat:
GitHubing

北䑓如法 Nyoho

:octocat:
GitHubing
View GitHub Profile
@Nyoho
Nyoho / gist:037b98be1d0d390b65e7
Created November 18, 2014 00:15
segmentation fault
...
/Users/nyoho/Library/Saved Application State
0 swift 0x0000000103392a68 llvm::sys::PrintStackTrace(__sFILE*) + 40
1 swift 0x0000000103392f54 SignalHandler(int) + 452
2 libsystem_platform.dylib 0x00007fff905bc5aa _sigtramp + 26
3 libsystem_platform.dylib 0x0000000000000014 _sigtramp + 1873033860
4 CarbonCore 0x00007fff894d13bf CSBackupIsItemExcluded + 92
5 CarbonCore 0x00007fff894d1502 CSBackupIsItemExcluded + 415
6 CarbonCore 0x00007fff894d1502 CSBackupIsItemExcluded + 415
7 CarbonCore 0x00007fff894d1502 CSBackupIsItemExcluded + 415
@Nyoho
Nyoho / hiki-rack.org
Last active August 29, 2015 14:12
hiki rack メモ
import Foundation
import Cocoa
//let s = String.fromCString(C_ARGV[0])
let s = "謹賀新年s㎃p"
var path = NSBezierPath()
//let font = NSFont.systemFontOfSize(24.0)
let font = NSFont(name: "HiraKakuStdN-W8", size: 24.0)!
@Nyoho
Nyoho / AmazonBookInfo.js
Created February 3, 2016 06:15
Amazon.co.jpの書籍情報をコピーするときに便利なブックマークレット
javascript:(function()%7Bvar%20a=document.getElementById('booksTitle').innerText;var%20b=document.getElementsByClassName('bucket');for(i=0;i<b.length;i++)if(/登録情報/i.test(b[i].innerHTML))var%20r='■%20'+a+b[i].innerText;r=r.replace(/おすすめ[\s\S]*らせる\n/,'');b=document.getElementsByTagName('b');for(i=0;i<b.length;i++)if(/ISBN-10/i.test(b[i].innerHTML))is=b[i].parentNode.innerHTML.match(/(\d{10})/);var%20e=document.createElement('textarea');e.style.width='100%25';e.value=r+'http://www.amazon.co.jp/dp/'+is[1]+'/\n';document.body.insertBefore(e,document.body.firstChild);e.focus();e.select();e.ondblclick=function()%7Be.parentNode.removeChild(e);%7D;e.oncopy=function()%7BsetTimeout(function()%7Be.parentNode.removeChild(e);%7D,1);return%20true;%7D%7D)()
@Nyoho
Nyoho / conftest.c
Last active April 5, 2016 07:36
ldd ~/local/lib/libcurl.so
/* confdefs.h. */
#define PACKAGE_NAME "git"
#define PACKAGE_TARNAME "git"
#define PACKAGE_VERSION "2.8.1"
#define PACKAGE_STRING "git 2.8.1"
#define PACKAGE_BUGREPORT "git@vger.kernel.org"
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
@Nyoho
Nyoho / get-swift-pkg
Last active April 13, 2016 03:37 — forked from jpmartha/get-swift-pkg
A Shell to download and install Swift Development Snapshots from Swift.org
#!/usr/bin/env bash
DEVELOPMENT_SNAPSHOTS_PATH=https://swift.org/builds/development/xcode
DEVELOPMENT_SNAPSHOTS_PREFIX=swift-DEVELOPMENT-SNAPSHOT-
echo
if [ -z "$1" ]; then
echo "OVERVIEW: Download and install Swift Development Snapshots from Swift.org."
echo
@Nyoho
Nyoho / New
Created April 13, 2016 14:02
UnixBench
# # # # # # # ##### ###### # # #### # #
# # ## # # # # # # # ## # # # # #
# # # # # # ## ##### ##### # # # # ######
# # # # # # ## # # # # # # # # #
# # # ## # # # # # # # ## # # # #
#### # # # # # ##### ###### # # #### # #
4 000 Based on the Byte Magazine Unix Benchmark
44 00 0
@Nyoho
Nyoho / random_problem.rb
Created May 1, 2016 04:57
重複のない整数対の配列を作る
def nn
(rand * 5).to_i + 1
end
def random_problem(n)
a = []
while a.length < n do
a.push [nn,nn]
a.uniq!
end
n = 2;
b = 5;
BlockRandom[SeedRandom[1, Method -> "MersenneTwister"];
a = # + 1 & /@
Table[IntegerDigits[RandomInteger[b^n - 1], b, n], 100]]
a // MatrixForm
@Nyoho
Nyoho / lti-nginx.conf
Last active May 17, 2018 07:26
nginx setting for LTI reverse proxy
server {
listen 80;
listen [::]:80;
server_name lti.nyoho.jp;
root /var/www/lti.nyoho.jp;
location /.well-known/acme-challenge/ { allow all; }
location / { return 301 https://$host$request_uri; }
}
server {