Skip to content

Instantly share code, notes, and snippets.

View iyanski's full-sized avatar

iyanski iyanski

View GitHub Profile
@iyanski
iyanski / restore
Created October 4, 2017 16:12 — forked from jgillman/restore.sh
pg_restore a local db dump into Docker
# Assumes the database container is named 'db'
DOCKER_DB_NAME="$(docker-compose ps -q db)"
DB_HOSTNAME=db
DB_USER=postgres
LOCAL_DUMP_PATH="path/to/local.dump"
docker-compose up -d db
docker exec -i "${DOCKER_DB_NAME}" pg_restore -C --clean --no-acl --no-owner -U "${DB_USER}" -d "${DB_HOSTNAME}" < "${LOCAL_DUMP_PATH}"
docker-compose stop db
@iyanski
iyanski / 0_reuse_code.js
Created March 2, 2017 06:01
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# Run this one-liner from the Sublime Text console if you need to revert all open documents
[ view.run_command('revert') for view in sublime.Window.views(sublime.active_window()) ]
@iyanski
iyanski / gist:2881872
Created June 6, 2012 13:31
Generating Innovative / New Business Ideas
Generating Innovative / New Business Ideas
How to generate new ideas
- Inspiration from existing innovations
- Follow your personal passion
- Annoyances
- Decommoditize a Commodity
- Attacking underserved Long-Tail Segments
- Going Low Touch / down market
- Follow social / demographics trends
Step 1 - Name Generation
- develop naming brief & plan, considering target market, desired brand attributes, etc.
- Condect name-storming sessions to generate up to 20-50 names
Step 2 - Online Search & Shortlist
- conduct online trademark & url search on the names generated
- evaluate and shortlist 10-12 names based on naming brief and trademark, url availability
Step 3 - Name Refinement & Selection
- based on search results, fine tune names if required
@iyanski
iyanski / defining_the_market.txt
Created May 31, 2012 21:27
Defining the market
Defining the market
- what are you?
- entering existing market - higher performance
- creating new market
- re-segment market as low cost player - low end customers
you need to have a plan on how to scale
- resegment market as niche player - go after core profitable segment
Defining your market
what are their benefits?
@iyanski
iyanski / console.rb
Created March 30, 2012 16:49
Counting results when specifying limit() in mongoid now works
1.9.2p290 :022 > Photo.all.count
=> 21
1.9.2p290 :023 > Photo.where(orientation: 'portrait').limit(2).count
=> 9
1.9.2p290 :024 > Photo.where(orientation: 'portrait').limit(2).count(true)
=> 2
1.9.2p290 :025 >
@iyanski
iyanski / console.rb
Created March 30, 2012 16:46
Counting results when specifying limit() in mongoid initially did not work
1.9.2p290 :022 > Photo.all.count
=> 21
1.9.2p290 :023 > Photo.where(orientation: 'portrait').limit(2).count
=> 9