View index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | |
<link rel='stylesheet' href="https://unpkg.com/@finos/perspective-viewer@0.4.6/dist/umd/material-dense.dark.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | |
<script src="https://unpkg.com/@finos/perspective-workspace"></script> | |
<script src="https://unpkg.com/@finos/perspective-viewer-datagrid"></script> |
View Deformer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void FlattenVolume() { | |
float flattenToY = Mathf.Lerp(deformerCollider.bounds.min.y, deformerCollider.bounds.max.y, flattenTo); | |
float flattenHeight = Coord.WorldHeightToTerrainHeight(flattenToY, terrain); | |
foreach (Vertex v in this.localHeightMap.localHeightmapVertices) { | |
if (v.insideDeformerCollider || (!v.insideDeformerCollider && this.flattenArea)) { | |
if (v.areaZ < this.terrainArea.terrainHeights.GetLength(0) || v.areaX < this.terrainArea.terrainHeights.GetLength(1)) { | |
this.terrainArea.terrainHeights[v.areaZ, v.areaX] = flattenHeight; | |
} | |
} |
View gtk3_error.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ ruby gtk3_test.rb | |
/Users/jarrod/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': dlopen(/Users/jarrod/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-13/2.2.0-static/glib2-2.2.5/glib2.bundle, 9): Library not loaded: @@HOMEBREW_PREFIX@@/opt/gettext/lib/libintl.8.dylib (LoadError) | |
Referenced from: /Users/jarrod/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-13/2.2.0-static/glib2-2.2.5/glib2.bundle | |
Reason: image not found - /Users/jarrod/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-13/2.2.0-static/glib2-2.2.5/glib2.bundle | |
from /Users/jarrod/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' | |
from /Users/jarrod/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/glib2-2.2.5/lib/glib2.rb:105:in `rescue in <top (required)>' | |
from /Users/jarrod/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/glib2-2.2.5/lib/glib2.rb:101:in `<top (required)>' | |
from /Users/jarrod/.rbenv/version |
View vcr_webmock_and_live_http_simultaneously.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'rspec' | |
require 'webmock' | |
require 'vcr' | |
require 'pry' | |
# in a Rails app, this would be in an initializer | |
WebMock.disable_net_connect!( | |
allow_localhost: true, | |
net_http_connect_on_start: true |
View gist:2346471
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> hsh = { :foo => ->(x){ {x: x } }} | |
=> {:foo=>#<Proc:0x007ff2c20320c0@(irb):9 (lambda)>} | |
>> hsh[:foo] | |
=> #<Proc:0x007ff2c20320c0@(irb):9 (lambda)> | |
>> hsh[:foo].call('qwerasdf') | |
=> {:x=>"qwerasdf"} |
View gist:1706581
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rest_client' | |
def import(service_url, uri, data) | |
JSON.parse( | |
RestClient.post( | |
"#{service_url}#{uri}", | |
data.to_json, | |
content_type: :json, | |
accept: :json | |
) |
View run_spec_multiple.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
ARGV[0].to_i.times do |i| | |
puts "run #{i+1}" | |
result = `rake SPEC=#{ARGV[1]}` | |
puts result.match(/(Finished in \d+.\d+ seconds)/)[1] | |
puts result.match(/(\d+ examples, \d+ failures?)/)[1] | |
if result.match(/Failed examples:/) | |
puts '' | |
puts 'Failed examples:' |
View backbone_sync_hack.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
Usage: | |
* add model.name property that will be used as a namespace in the json request | |
* put this code before your Backbone app code | |
* use toJSON() as usual (so there is no namespacing in your templates) | |
* your model's data will be sent under model.name key when calling save() | |
### | |
# save reference to Backbone.sync | |
Backbone.oldSync = Backbone.sync |
View backbone.rails.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Backbone.Rails.js | |
// | |
// Makes Backbone.js play nicely with the default Rails setup, i.e., | |
// no need to set | |
// ActiveRecord::Base.include_root_in_json = false | |
// and build all of your models directly from `params` rather than | |
// `params[:model]`. | |
// | |
// Load this file after backbone.js and before your application JS. |
NewerOlder