Skip to content

Instantly share code, notes, and snippets.

View ioquatix's full-sized avatar
⚖️
Let's make it scalable!

Samuel Williams ioquatix

⚖️
Let's make it scalable!
View GitHub Profile
@ioquatix
ioquatix / convert.rb
Created November 4, 2012 01:17
Collada to TaggedFormat conversion tool.
#!/usr/bin/env ruby
require 'collada/parser/library'
path = ARGV[0]
doc = REXML::Document.new(File.open(path))
library = Collada::Parser::Library.parse(doc)
class Mesh
x_x > gem install thin
Building native extensions. This could take a while...
ERROR: Error installing thin:
ERROR: Failed to build gem native extension.
/Users/samuel/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
checking for main() in -lssl... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
have_library: checking for glVertex3d() in -lopengl32.lib... -------------------- no
"/opt/local/bin/gcc-apple-4.2 -o conftest -I/Users/samuel/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/x86_64-darwin12.2.0 -I/Users/samuel/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1/ruby/backward -I/Users/samuel/.rvm/rubies/ruby-1.9.3-p362/include/ruby-1.9.1 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/opt/local/include -I/Users/samuel/.rvm/usr/include -O2 -arch x86_64 -fno-common -pipe conftest.c -L. -L/Users/samuel/.rvm/rubies/ruby-1.9.3-p362/lib -L/Users/samuel/.rvm/usr/lib -L. -L/opt/local/lib -L/Users/samuel/.rvm/usr/lib -lruby.1.9.1 -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
#!/usr/bin/env ruby
require 'merge3'
ORIGINAL = <<EOF
Hello World
Foo Bar
EOF
@ioquatix
ioquatix / gist:3436e16a83ea867a5885
Created September 11, 2014 23:11
ZFS Hang under memory pressure.
[233482.058622] INFO: task txg_sync:566 blocked for more than 120 seconds.
[233482.058779] Tainted: P O 3.16.1-1-ARCH #1
[233482.058874] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[233482.059008] txg_sync D 0000000000000000 0 566 2 0x00000000
[233482.059018] ffff8800ca38bbb0 0000000000000046 ffff8800cf1cbd20 0000000000014580
[233482.059026] ffff8800ca38bfd8 0000000000014580 ffff8800cf1cbd20 0000000000000046
[233482.059033] ffff8800ca38bb38 ffffffff810a2aff ffffc90024149920 0000000000000000
[233482.059040] Call Trace:
[233482.059055] [<ffffffff810a2aff>] ? try_to_wake_up+0x1ff/0x380
[233482.059064] [<ffffffff810a2ce2>] ? default_wake_function+0x12/0x20
#!/usr/bin/env ruby
require 'rubydns'
require 'rubydns/extensions/string'
INTERFACES = [
[:udp, '0.0.0.0', 5300],
[:tcp, '0.0.0.0', 5300]
]
#!/usr/bin/env ruby
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
diff --git a/src/libscotch/Makefile b/src/libscotch/Makefile
index 073ac01..64abd50 100644
--- a/src/libscotch/Makefile
+++ b/src/libscotch/Makefile
@@ -2963,7 +2963,7 @@ ptscotchf.h : ptdummysizes$(EXE) \
./ptdummysizes$(EXE) library_pt_f.h ptscotchf.h
libscotch$(LIB) : $(LIBSCOTCHDEPS)
- $(AR) $(ARFLAGS) $(@) $(?)
+ $(AR) $(ARFLAGS) $(@) $(?) $(LDFLAGS)
/*
* Your Stylesheet
*
* This stylesheet is loaded when Atom starts up and is reloaded automatically
* when it is changed.
*
* If you are unfamiliar with LESS, you can read more about it here:
* http://www.lesscss.org
*/
@ioquatix
ioquatix / mipmaps.cpp
Created July 31, 2016 01:03
vulkan mip maps
void Renderer::generate_mipmaps(vk::CommandBuffer commands, DeviceImage image) {
size_t levels = image.info.mipLevels();
assert(levels > 0);
vk::Extent3D extent = image.info.extent();
vk::Offset3D upper (extent.width(), extent.height(), extent.depth());
auto prepare_write = vk::ImageMemoryBarrier()
.dstAccessMask(vk::AccessFlagBits::eTransferWrite)