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
class Polygon | |
RAD_TO_DEG = (180 / Math::PI) | |
DEG_TO_RAD = (Math::PI / 180) | |
def self.all(h) | |
a = {} | |
(3..100).each do |n| | |
a[n] = call(h, n) | |
end | |
a |
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
def converted_prices_for(price) | |
Currency.supported_for_selling.each_with_object({}) do |listing_currency, all_prices| | |
exchanged_amount = Reverb::ExchangeBanks | |
.exchange_with_inverse_paypal_rates(money: price, to_currency: listing_currency) | |
.cents | |
all_prices[listing_currency] = exchanged_amount | |
end | |
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
#!/usr/bin/env ruby | |
require 'json' | |
require 'net/http' | |
require 'pp' | |
member_data = JSON.parse(File.read('members.json')) | |
member_data.each do |leg_data| | |
need_geo = leg_data["offices"].select { |o| o["latitude"] == "xxx" } | |
next if need_geo == [] |
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
========================================================================================================================== | |
// With Backtraces in steno logs | |
========================================================================================================================== | |
=============================================================== x10======================================================= | |
[geoff@dealestate-app1-staging ~]$ ab -n 5000 -c 10 http://gdag-app1-uat.snc1:8080/v1/deals/207bfbcb-ed30-4bd1-81e6-dbeafccdbc86 | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ |
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
echo "export PATH=/usr/local/bin:$PATH" > ~/.bashrc | |
cat ~/.bashrc |
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
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> | |
<style> | |
body { margin: 0; padding: 0;} | |
.codemarks { | |
width: 960px; | |
height: 500px; | |
margin: 0 auto; | |
background: blue; |
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
[user] | |
email = your_email | |
name = Your Name | |
[core] | |
editor = vim | |
[color] | |
ui = true | |
[alias] | |
st = status | |
ci = commit |
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
function git_remote_url() { | |
# DOES NOT WORK FOR HTTPS, ONLY [email protected]:username/repo.git | |
git config --get remote.origin.url | sed 's/git@//' | sed 's/github/https:\/\/github/' | sed 's/com:/com\//' | sed 's/\.git//' | |
} | |
function git_current_branch_name() { | |
git symbolic-ref HEAD | sed 's/refs\/heads\///' | |
} | |
function git_push_open() { |
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
cntl i | |
cntl o | |
hop between cursor positions | |
cntl u | |
cntl f | |
cntl d | |
cntl b | |
page and half page |
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
NameVirtualHost [ip_address] | |
<VirtualHost [ip_address]> | |
DocumentRoot /home/codemarks/www/codemarks/public | |
ServerName www.codemarks.com | |
ServerAlias codemarks.com | |
RailsEnv production | |
<Directory /home/codemarks/www/codemarks/public> | |
AllowOverride all | |
Options -MultiViews |
NewerOlder