Skip to content

Instantly share code, notes, and snippets.

Avatar
🏈
Go 49ers!

Ryosuke Iwanaga riywo

🏈
Go 49ers!
View GitHub Profile
View gist:b36c7cd7ef2560b0e5e1a713205d8e28
$ ./runsample open foo.db
COMMAND: scan
START KEY: {"name": "bar", "timestamp": 0}
END KEY: {"name": "foo", "timestamp": 100}
{"name": "bar", "timestamp": 1} {"value": "bbb"}
{"name": "bar", "timestamp": 10} {"value": "bbb"}
{"name": "foo", "timestamp": 1} {"value": "bbb"}
{"name": "foo", "timestamp": 10} {"value": "bbb"}
View dict.ll
declare i32 @putchar(i32)
declare i8* @gets(i8* nocapture) nounwind
declare i32 @strcmp(i8*, i8*) nounwind
%node = type{ %node*, i8*, i32 }
@foo.key = private constant [4 x i8] c"foo\00"
@foo = private constant %node {
%node* @bar,
i8* getelementptr([4 x i8], [4 x i8]* @foo.key, i32 0, i32 0),
View itc.ll
declare i32 @putchar(i32)
@xt_A = private constant i8* blockaddress(@main, %i_A)
@xt_B = private constant i8* blockaddress(@main, %i_B)
@xt_exit = private constant i8* blockaddress(@main, %i_exit)
@code = private constant [5 x i8**] [
i8** @xt_A,
i8** @xt_B,
i8** @xt_A,
View dtc.ll
declare i32 @putchar(i32)
@code = private constant [5 x i8*] [
i8* blockaddress(@main, %A),
i8* blockaddress(@main, %B),
i8* blockaddress(@main, %A),
i8* blockaddress(@main, %B),
i8* blockaddress(@main, %exit)
]
View CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(myproject)
set(CMAKE_CXX_STANDARD 14)
find_package(LLVM REQUIRED CONFIG)
include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
View httpd.conf
<VirtualHost *>
ServerName blog.riywo.com
ProxyPreserveHost On
ProxyRequests off
<Proxy balancer://blog>
BalancerMember http://localhost:1313
BalancerMember http://blog.riywo.com.s3-website-us-west-2.amazonaws.com status=+H
</Proxy>
ProxyPass / balancer://blog/
</VirtualHost>
View gist:9976219fd5fd7fb22ea6
aws_s3_sync = "aws --region us-west-2 s3 sync public s3://blog.riywo.com --delete --storage-class=REDUCED_REDUNDANCY"
task :default => :server
task :server do
sh 'rm -fr public'
exec 'hugo server -b http://blog.riywo.com --appendPort=false -w --disableLiveReload'
end
task :test do
sh %Q{#{aws_s3_sync} --dryrun --size-only}
View gist:d77903a393e2f8df1580
<main class="content" role="main">
<article class="post post-section {{ .Section }}">
{{ range .Data.Pages.GroupByDate "Jan 2006" }}
<h3>{{ .Key }}</h3>
<ul>
{{ range .Pages }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
</li>
{{ end }}
View gist:0aee4f20f6f8a2a35242
classification=spark-defaults,properties=[spark.dynamicAllocation.enabled=true,spark.executor.memory=2G,spark.executor.cores=2]
@riywo
riywo / c.coffee
Last active December 29, 2015 09:59
comprehension
View c.coffee
coffee> i*i for i in [1..9] when i % 2 == 0
[ 4, 16, 36, 64 ]
# https://github.com/jashkenas/coffee-script/issues/2030
# http://brehaut.net/blog/2011/coffeescript_comprehensions
coffee> [i,j] for j in [1..3] for i in [1..3]
[ [ [ 1, 1 ],
[ 1, 2 ],
[ 1, 3 ] ],
[ [ 2, 1 ],