Skip to content

Instantly share code, notes, and snippets.

View kt3k's full-sized avatar

Yoshiya Hinosawa kt3k

View GitHub Profile
@zliuva
zliuva / gist:1084476
Last active July 31, 2023 21:32
A minimal Mach-o x64 executable for OS X
; A minimal Mach-o x64 executable for OS X (also see below Mountain Lion version)
;
; $ nasm -f bin -o tiny_hello tiny_hello.s
; $ chmod +x tiny_hello
; $ ./tiny_hello
; Hello World!
; $
; c.f.
; http://osxbook.com/blog/2009/03/15/crafting-a-tiny-mach-o-executable/ ( the original tiny mach-o executable )
@mbostock
mbostock / .block
Last active March 29, 2023 23:39
Collapsible Indented Tree
license: gpl-3.0
redirect: https://observablehq.com/@d3/indented-tree
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active June 9, 2024 23:19
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version
@aleung
aleung / ApplicationContextDumper.java
Created November 8, 2011 06:41
Dump beans information in a Springframework application context. Licensed under WTFPL v2. More detail in blog post: http://aleung.github.io/blog/2011/11/08/Dump-beans-information-from-live-Spring-application-context/
package leoliang.springtest;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.support.AbstractRefreshableApplicationContext;
> perl -E 'say "生" & "死"'
生 Life U+751F \xe7\x94\x9f 11100111 10010100 10011111
死 Death U+6B7B \xe6\xad\xbb 11100110 10101101 10111011
愛 Love u+611B \xe6\x84\x9b 11100110 10000100 10011011
@AvnerCohen
AvnerCohen / npm-cheat-sheet.md
Last active July 9, 2023 09:14
Node.js - npm Cheat Sheet

Node.js - npm Cheat Sheet

(Full description and list of commands at - https://npmjs.org/doc/index.html)

List of less common (however useful) NPM commands

Prepand ./bin to your $PATH

Make sure to export your local $PATH and prepand relative ./node_modules/.bin/:

@mbostock
mbostock / .block
Last active November 7, 2023 07:54
Collapsible Tree
license: gpl-3.0
redirect: https://observablehq.com/@d3/d3-collapsible-tree
@mia-0032
mia-0032 / file_get_contents_with_exception.php
Last active December 10, 2015 03:28
file_get_contentsでException飛ばすメモ
<?php
try {
ob_start();
//warningが出るコード
$file = file_get_contents('./not_found_file.txt');
$warning = ob_get_contents();
ob_end_clean();
//Warningがあれば例外を投げる
if ($warning) {
@cowboy
cowboy / call-invo-cursion.js
Last active March 30, 2023 01:59
JavaScript: call invo-cursion?
// OOP
console.log( 'OHAI'.blink() );
// Call invocation
console.log( String.prototype.blink.call('OHAI') );
// $ always makes things look awesome.
var $ = Function.prototype.call;
// Very explicit call invocation
@searls
searls / japan_guide.md
Last active November 3, 2017 15:19
Japanese Travel Survival Guide

Japanese Travel Survival Guide

Update 8/16/2015: I updated this guide a bit and posted it to Medium

A few notes about things I do when I travel to Japan.

Survival

Travel light