Skip to content

Instantly share code, notes, and snippets.

View asterite's full-sized avatar

Ary Borenszweig asterite

  • NoRedInk
  • Buenos Aires, Argentina
View GitHub Profile
libmylib.so: mylib.cr
crystal mylib.cr --link-flags "-dynamic -bundle -Wl,-undefined,dynamic_lookup" -o libmylib.dylib
.PHONY: clean run
clean:
rm *.dylib
run: libmylib.dylib
ruby mylib.rb
@asterite
asterite / mylib.cr
Last active December 4, 2015 13:27
@[Link(ldflags: "#{__DIR__}/libmylib.so")]
lib MyLib
fun add(Int32, Int32) : Int32
end
puts MyLib.add(11, 31)
a = 1
b = 1
while 1
b = a
a = false
end
b
@[Link("git2")]
lib LibGit2
PATH_MAX = 4096
ATTR_CHECK_FILE_THEN_INDEX = 0
ATTR_CHECK_INDEX_THEN_FILE = 1
ATTR_CHECK_INDEX_ONLY = 2
OID_RAWSZ = 20
OID_MINPREFIXLEN = 4
BLAME_OPTIONS_VERSION = 1
DIFF_OPTIONS_VERSION = 1
require "json"
require "http/web_socket"
macro every(time_span)
spawn do
loop do
sleep({{time_span}})
{{yield}}
end
end
require "compiler/crystal/**"
# This is OK
filename = ARGV[0]?
abort "missing filename" unless filename
if filename == "--all"
files = Dir["./**/*.cr"]
count = 0
files.each do |file|
require "http/client"
require "json"
module Bountysource
class API
def initialize
@client = HTTP::Client.new "www.bountysource.com", ssl: true
end
def timeline(team_id, page = 1, per_page = 30) : Array(Event)
AI Anguilla
AL Albania
AM Armenia
fun foo : Int32
"foobar".count { |c| c == 'o' }
end
foo

Keybase proof

I hereby claim:

  • I am asterite on github.
  • I am asterite (https://keybase.io/asterite) on keybase.
  • I have a public key ASBohtwNjJVF4k1bMZEJ01rGqfbAPDqM2SfVl2U3zHt46go

To claim this, I am signing this object: