Skip to content

Instantly share code, notes, and snippets.

View hymkor's full-sized avatar

HAYAMA_Kaoru hymkor

View GitHub Profile
@theconektd
theconektd / github.css
Created April 30, 2012 02:11
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@echo off
echo LIBRARY mruby.dll > mruby.def
echo EXPORTS >> mruby.def
nm libmruby.a | grep "\ T\ _mrb" | sed s/".*\\ T\\ _"// >> mruby.def
gcc -s -mdll -o mruby.dll mruby.def libmruby.a -Wl,--out-implib,libmruby.dll.a
@nocd5
nocd5 / pcd_for_nyagos.lua
Created September 20, 2014 15:43
nyagosでpecoを使ったディレクトリ移動を行う
alias{
pcd = function ()
local line = nyagos.eval("ls -la") -- nyagos組み込みの`ls`
local complst = split(line, "[\r\n]")
local directories = ""
for i, e in ipairs(complst) do
-- 末尾が'/'ならディレクトリって事で決め打ち
if (e:match('.+/$')) then
-- ls -lの結果が
-- <パーミション> <サイズ> <日付> <時間> <ファイル名 or ディレクトリ名>
@pine
pine / touch.lua
Created February 12, 2015 10:58
touch command for NYAGOS. License: Public Domain.
nyagos.alias('touch', function(args)
if #args <= 0 then
print 'Usage: touch FILENAME'
return
end
local fd = io.open(args[1])
if fd then
fd:close()
@yuba
yuba / regex_with_TCHAR.cpp
Created July 31, 2015 07:26
TCHARを使っているC++プロジェクトでC++11正規表現を使おうとするとこういうインクルードをすることになる
#include <regex>
namespace std {
#ifdef _UNICODE
typedef std::wstring tstring;
typedef std::wregex tregex;
typedef std::wsmatch tsmatch;
#else
typedef std::string tstring;
typedef std::regex tregex;
typedef std::smatch tsmatch;
@artyom
artyom / chat.go
Created March 12, 2016 22:06
Example of interactive terminal in Go
package main
import (
"fmt"
"io"
"log"
"os"
"golang.org/x/crypto/ssh/terminal"
)
@sifue
sifue / 無料で読めるポール・グレアムの「ハッカーと画家」+αの日本語訳のみのまとめ.md
Last active June 22, 2024 04:27
無料で読めるポール・グレアムの「ハッカーと画家」+αの日本語訳のみのまとめ
Copyright (c) 2014 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
@fnky
fnky / ANSI.md
Last active June 27, 2024 00:07
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27