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
#!/usr/bin/env perl | |
# cf. https://twitter.com/dankogai/status/1474270327006195718 | |
use strict; | |
use warnings; | |
use feature 'say'; | |
sub eqpath { | |
my @lhs = lstat( $_[0] ) or return; | |
my @rhs = lstat( $_[1] ) or return; | |
# if device numbers and inode numbers are the same, they are identical |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
int main(int argc, char *argv[]) | |
{ | |
if (argc <= 1) | |
{ | |
fprintf(stdout, "usage:\n\t%s cmd [args...]\n", argv[0]); | |
exit(-1); |
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
(($)=>$+JSON.stringify($)+")")("(($)=>$+JSON.stringify($)+\")\")(") |
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
$ cd ~ # home directory で作業 | |
$ sudo apt-get install clang libicu-dev libcurl4 | |
$ wget https://swift.org/builds/swift-4.2-release/ubuntu1804/swift-4.2-RELEASE/swift-4.2-RELEASE-ubuntu18.04.tar.gz | |
$ tar xvpf swift-4.2-RELEASE-ubuntu18.04.tar.gz | |
$ export PATH=~/swift-4.2-RELEASE-ubuntu18.04/usr/bin:$PATH |
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
#include <dlfcn.h> | |
#include <math.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#define DBL_ULPOFONE 0x1p-52 | |
void *load_cbrt(void **dlhp, char *path){ | |
*dlhp = dlopen(path, RTLD_LAZY); | |
if (*dlhp == NULL) { | |
fprintf(stderr, "%s\n", dlerror()); |
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
#!/usr/bin/env swift | |
// cf. https://twitter.com/mattn_jp/status/987128843633770496 | |
import Foundation | |
while true { | |
""" | |
(´・_・`)´・_・`) | |
(´・_・`)_・`) |
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
// | |
// digest.swift | |
// CryptoDigest | |
// | |
// Created by Dan Kogai on 2018/03/19. | |
// Copyright © 2018 Dan Kogai. All rights reserved. | |
// | |
import Foundation | |
import CommonCrypto |
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
let newArray = (n) => { | |
let o = Object.create(null); | |
Object.setPrototypeOf(o, Array.prototype); | |
Object.defineProperty(o, 'length', {value:n}); | |
return o; | |
} | |
// let a = newArray(2); | |
// console.log((a).map) | |
// console.log((a).map($=>"hello")) |
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
#!/bin/sh | |
# | |
# Use at your own risk | |
# | |
hdiutil create -o /tmp/macOS13.cdr -size 5130m -layout SPUD -fs HFS+J | |
hdiutil attach /tmp/macOS13.cdr.dmg -noverify -mountpoint /Volumes/cdrimg | |
sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/cdrimg | |
mv /tmp/macOS13.cdr.dmg ~/Desktop/macOS13.dmg | |
hdiutil detach /Volumes/Install\ macOS\ High\ Sierra | |
hdiutil convert ~/Desktop/macOS13.dmg -format UDTO -o ~/Desktop/macOS13.iso |
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
fn =\x{304b}\x{3070}\x{3093}.txt | |
fn_nfd =\x{304b}\x{306f}\x{3099}\x{3093}.txt | |
かばん.txt:No such file or directory at ./test.pl line 32. | |
. | |
.. | |
\x{304b}\x{3070}\x{3093}.txt |
NewerOlder