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
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
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 'rgeo' | |
# RGeo factory for spherical latlong points | |
rgeo_factory = RGeo::Geographic.spherical_factory(:srid => 4326) | |
coord = rgeo_factory.point(-111.500244140625, 40.84706035607122) | |
# => RGeo point "Point (-111.500244140625 40.84706035607122)" | |
point_text = RGeo::WKRep::WKBGenerator.new(hex_format: true, type_format: :ewkb, emit_ewkb_srid: true).generate(coord) | |
# => "0020000001000010e6c05be0040000000040446c6c79478831" # this is what is stored in Postgres | |
new_coord = RGeo::WKRep::WKBParser.new(rgeo_factory, support_ewkb: true, default_srid: 4326).parse(point_text) | |
# => RGeo point "Point (-111.500244140625 40.84706035607122)" | |
new_coord == coord # => true |
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
# crystal version: 0.17.4 | |
struct Char | |
def blank? | |
case ord | |
when 9, 0xa, 0xb, 0xc, 0xd, 0x20, 0x85, 0xa0, 0x1680, 0x180e, | |
0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, | |
0x2007, 0x2008, 0x2009, 0x200a, 0x2028, 0x2029, 0x202f, | |
0x205f, 0x3000 then true | |
else | |
false |
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
/* | |
--------------------- | |
Author: Paul Hoffer | |
Github: phoffer | |
Twitter: @phoffer8 | |
Version: 1.0 | |
--------------------- | |
# Purpose |
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
server { | |
listen 80; | |
server_name localhost mc.local; | |
root /Users/paul/Projects/mc/public; | |
try_files $uri/index.html $uri @app; | |
# Send everything to the app defined in the upstream | |
location /todo { |
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
module DarkLaunch | |
FEATURES = %w(feature_a feature_b feature_c) # could load this from a config file | |
def self.included(base) | |
FEATURES.each do |f| | |
base.send(:define_method, "has_access_to_#{f}?") { DarkLaunch.feature_visible(f, self) } | |
end | |
# could add a method_missing handler for the same prefix, for things that aren't explicitly defined | |
end |
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
ENV['MONGOLAB_URI'] = 'mongodb://user:pass@server:port/db_name' | |
ENV['other_ENV_var'] = 'other environment variable' | |
spawn 'thin -R config.ru start -p 3000' |