Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@notozeki
notozeki / plot.rb
Last active December 31, 2016 13:27
require 'csv'
require 'numo/gnuplot' # You must run `gem install numo-gnuplot`
KEYWORD = 'にのめ'
tweets_file_path = ARGV[0] || 'tweets.csv'
csv = CSV.open(tweets_file_path, headers: true)
# Convert from CSV to array of Hash.
tweets = csv.map {|row| row.to_hash }
@notozeki
notozeki / Makefile
Last active March 22, 2023 16:27
An example Ruby extension written in Crystal
CRYSTAL = crystal
UNAME = "$(shell uname -ms)"
LIBRARY_PATH = $(shell brew --prefix crystal-lang)/embedded/lib
LIBS = -levent -lpcl -lpcre -lgc -lpthread
LDFLAGS = -Wl,-undefined,dynamic_lookup
TARGET = crystal_example_ext.bundle
$(TARGET): crystal_example_ext.o
$(CC) -bundle -L$(LIBRARY_PATH) -o $@ $^ $(LIBS) $(LDFLAGS)