Skip to content

Instantly share code, notes, and snippets.

View ryanstout's full-sized avatar

Ryan Stout ryanstout

View GitHub Profile
producer[x, y] = hl.sin(x * y)
consumer[x, y] = (producer[x, y] +
producer[x, y+1] +
producer[x+1, y] +
producer[x+1, y+1])/4
xo, yo, xi, yi = hl.Var("xo"), hl.Var("yo"), hl.Var("xi"), hl.Var("yi")
consumer.tile(x, y, xo, yo, xi, yi, 4, 4)
producer.compute_at(consumer, xo)
0.000097 main (2): ALWAYS INCLUDE THE FOLLOWING LINES WHEN SENDING DEBUG MESSAGES TO THE MAILING LIST:
0.000124 main (2): gphoto2 2.5.17.1
0.000129 main (2): gphoto2 has been compiled with the following options:
0.000132 main (2): + gcc (C compiler used)
0.000135 main (2): + popt (mandatory, for handling command-line parameters)
0.000138 main (2): + exif (for displaying EXIF information)
0.000140 main (2): + no cdk (for accessing configuration options)
0.000143 main (2): + no aa (for displaying live previews)
0.000145 main (2): + jpeg (for displaying live previews in JPEG format)
0.000147 main (2): + no readline (for easy navigation in the shell)
@ryanstout
ryanstout / opal.js
Created November 20, 2013 23:36
Opal generated code
(function(undefined) {
// The Opal object that is exposed globally
var Opal = this.Opal = {};
// The actual class for BasicObject
var RubyBasicObject;
// The actual Object class
var RubyObject;
@ryanstout
ryanstout / gist:5959461
Created July 9, 2013 17:40
Lets you do: a = 5 ; b = 10 ; c = 30 ; 'a, b, c'.h # => {a: 5, b: 10, c: 30}
require 'binding_of_caller'
class String
def h
args = self.split(/,/).map {|a| a.strip }
arg_vals = args.map {|a| [a, binding.of_caller(2).eval(a)] }
return Hash[arg_vals]
end
<!-- CrowdTranslator JS -->
<script type="text/javascript">
(function() {
var ct = document.createElement('script'); ct.type = 'text/javascript'; ct.async = true;
ct.src = ('https:' == document.location.protocol ? 'https://d20z6ezet11y6s.cloudfront.net' : 'http://jscdn.crowdtranslator.com') + '/javascripts/page_translator.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ct, s);
})();
</script>
<!-- End CrowdTranslator JS -->
# How to run a generator from a plugin's install.rb
begin
# First have to load up rails
unless Kernel.const_defined?('RAILS_ROOT')
Kernel.const_set('RAILS_ROOT', File.join(File.dirname(__FILE__), '..', '..', '..'))
end
if (File.exists?(RAILS_ROOT) && File.exists?(File.join(RAILS_ROOT, 'app')))
require "#{RAILS_ROOT}/config/boot"
<!DOCTYPE html>
<html>
<%# IMPORTANT: Please read before changing! %>
<%# This file is rendered on the server using ERB, so it does NOT use Volt's %>
<%# normal template system. You can add to it, but keep in mind the template %>
<%# language difference. This file handles auto-loading all JS/Opal and CSS. %>
<head>
<meta charset="UTF-8" />
<%= javascript_tags %>
<%= css_tags %>
daemon off;
events {
worker_connections 4096; ## Default: 1024
}
http {
include mime.types;
# serve static files when asked to
sendfile on;
module InGem
class BlueController
def index
puts 'in gem'
end
class BlueTemplate
def path
'blue_template'
end
daemon off;
events {
worker_connections 4096; ## Default: 1024
}
http {
include mime.types;
# serve static files when asked to
sendfile on;