Skip to content

Instantly share code, notes, and snippets.

/* @flow */
declare module 'dynamoose' {
declare type Throughput = number | ({
read: number;
} | {
write: number;
});
declare type ThroughputConfig = {
throuput: Throughput;
@mrgcohen
mrgcohen / yardoc_cheatsheet.md
Last active September 15, 2015 17:33 — forked from chetan/yardoc_cheatsheet.md
YARD cheatsheet

YARD CHEATSHEET http://yardoc.org

cribbed from http://pastebin.com/xgzeAmBn

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

Namespace for classes and modules that handle serving documentation over HTTP

@mrgcohen
mrgcohen / psql_dump_tables.sh
Created June 2, 2015 14:41
dump tables from psql as csv
psql -c "COPY tablename TO stdout DELIMITER ',' CSV HEADER" datasbasename -U username -h hostname -W > filename.csv
@mrgcohen
mrgcohen / rails-intro-with-generators.md
Created February 7, 2015 16:50
Rails Intro and Scaffolding

Prototyping in Rails

I'm assuming you're on Linux or a Mac. If you aren't - Google is your friend. Fortunately there's a ton of documentation out there so you shouldn't have too much trouble setting things up.

Machine Setup

RVM and Ruby-2.2.0 Installation

  1. Install RVM to manage Ruby - Go to https://rvm.io/ and install (should be 1-2 calls to install)
  2. Lets install ruby-2.2.0 and make it our default
@mrgcohen
mrgcohen / DirectionsForLoadingCSVInToMysql.md
Last active August 29, 2015 14:11
Mysql Import from excel on mac

Import Excel file (mac) into Mysql

  1. Save as csv
  2. run sql 'mysql_import_csv_from_excel.sql'
# WINDOWS: Add domain user and put them in Domain Admins group
net user username password /ADD /DOMAIN
net group "Domain Admins" username /ADD /DOMAIN
# WINDOWS: Add local user and put them local Administrators group
net user username password /ADD
net localgroup Administrators username /ADD
# LINUX: Add a new user to linux and put them in the wheel group
useradd -G wheel username
<!DOCTYPE html>
<html>
<head>
<script src="background.js"></script>
</head>
<body>
<textarea id="sandbox"></textarea>
</body>
@mrgcohen
mrgcohen / GroupRidesBaltimore.md
Last active August 29, 2015 14:05
Group Rides Baltimore, Maryland

Times change to 5:30 after daylight savings

Monday @ 6pm

  1. Race Pace Key Highway, easy ride
  2. Lutherville Bike Shop, faster ride

Tuesday @ 6pm

  1. Race Pace Ellicot City, faster ride
@mrgcohen
mrgcohen / group_by_date_postgres.rb
Created August 1, 2014 13:52
group by date postgres, nice cast
Table.select("field1, created_at::timestamp::date").group("field1, created_at::timestamp::date")
@mrgcohen
mrgcohen / intercom.rb
Last active August 29, 2015 14:00
Intercom hash setup secure mode
intercom_hash = Base64.encode64(
OpenSSL::HMAC.digest(
OpenSSL::Digest::Digest.new('sha256'),
IntercomRails.config.api_secret,
the_user_id_if_being_sent_otherwise_users_email_address
)
).strip()