This file contains hidden or 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
/** | |
* Custom implementation that enables PropTypes checks in preact | |
* | |
* Based on: | |
* - https://github.com/developit/preact-compat | |
* - https://github.com/developit/preact/issues/902#issuecomment-334507942 | |
*/ | |
import { options, Component } from 'preact' | |
import PropTypes from 'prop-types' |
This file contains hidden or 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
defmodule Teenager do | |
def hey(input) do | |
cond do | |
silence? input -> | |
"Fine. Be that way!" | |
question? input -> | |
"Sure." | |
yeling?(input) and !nonsense?(input) -> | |
"Whoa, chill out!" | |
true -> "Whatever." |
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "../triforce-packer/triforce_vmware.box" | |
end |
This file contains hidden or 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
Bringing machine 'default' up with 'vmware_fusion' provider... | |
==> default: Verifying vmnet devices are healthy... | |
==> default: Preparing network adapters... | |
==> default: Starting the VMware VM... | |
==> default: Waiting for machine to boot. This may take a few minutes... | |
default: SSH address: 172.16.31.183:22 | |
default: SSH username: vagrant | |
default: SSH auth method: private key | |
default: Warning: Connection timeout. Retrying... | |
==> default: Machine booted and ready! |
This file contains hidden or 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
<snippet> | |
<content><![CDATA[ | |
define([${1} | |
], | |
function (${2}) { | |
${3} | |
}); | |
]]></content> | |
<tabTrigger>def</tabTrigger> |
This file contains hidden or 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
# Allows Mongoid's single collection inheritance to work with the Asset pipeline | |
# without enabling model preloading, which greatly reduces the performance of | |
# the application in development mode. | |
# see: http://martinciu.com/2011/06/rails-3-1-and-slow-asset-pipeline.html | |
# see: http://groups.google.com/group/mongoid/browse_thread/thread/3d37977a321dc56d?pli=1 | |
# see: http://mongoid.org/docs/rails/railties.html | |
config.to_prepare do | |
Dir["#{Rails.root}/app/models/*.rb"].each {|file| require file } | |
end |
This file contains hidden or 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 'rgeo' | |
# factory = RGeo::Geos.factory() | |
# factory = RGeo::Geographic.spherical_factory() | |
factory = RGeo::Geographic.simple_mercator_factory() | |
p1 = factory.point 0, 0 | |
p2 = factory.point 0, 2 | |
p3 = factory.point 2, 2 | |
p4 = factory.point 2, 0 |