Skip to content

Instantly share code, notes, and snippets.

View coryt's full-sized avatar
💡
Learning

Cory Taylor coryt

💡
Learning
View GitHub Profile
@coryt
coryt / postgres_queries_and_commands.sql
Created August 12, 2021 23:24 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@coryt
coryt / shell.exs
Created April 10, 2020 04:25 — forked from iboard/shell.exs
Elixir-script template for the commandline.
#!/usr/bin/env elixir
#
# A Template for writing an Elixir script to be used on the
# command-line.
#
# (c) 2019 by Andreas Altendorfer <andreas@altendorfer.at>
# License: Free to use without any warranty.
#
# Usage:
# 1. Add your command to strict and aliases on @opts
@coryt
coryt / go-shebang-story.md
Created April 10, 2020 03:40 — forked from posener/go-shebang-story.md
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

Keybase proof

I hereby claim:

  • I am coryt on github.
  • I am coryt (https://keybase.io/coryt) on keybase.
  • I have a public key ASC1JVhvDlIF56ItfE1SmHruCl6jd6RT_CROymD4GvwdTAo

To claim this, I am signing this object:

@coryt
coryt / gist:406193fe9853f434922f082bb29edca0
Created March 8, 2018 21:09 — forked from SzymonPobiega/gist:5220595
DDD/CQRS/ES/Architecture videos

If you have two days to learn the very basics of modelling, Domain-Driven Design, CQRS and Event Sourcing, here's what you should do:

In the evenings read the [Domain-Driven Design Quickly Minibook]{http://www.infoq.com/minibooks/domain-driven-design-quickly}. During the day watch following great videos (in this order):

  1. Eric Evans' [What I've learned about DDD since the book]{http://www.infoq.com/presentations/ddd-eric-evans}
  2. Eric Evans' [Strategic Design - Responsibility Traps]{http://www.infoq.com/presentations/design-strategic-eric-evans}
  3. Udi Dahan's [Avoid a Failed SOA: Business & Autonomous Components to the Rescue]{http://www.infoq.com/presentations/SOA-Business-Autonomous-Components}
  4. Udi Dahan's [Command-Query Responsibility Segregation]{http://www.infoq.com/presentations/Command-Query-Responsibility-Segregation}
  5. Greg Young's [Unshackle Your Domain]{http://www.infoq.com/presentations/greg-young-unshackle-qcon08}
  6. Eric Evans' [Acknowledging CAP at the Root -- in the Domain Model]{ht
@coryt
coryt / com.yourcompany.autossh.plist
Created October 20, 2016 14:41 — forked from venj/com.yourcompany.autossh.plist
Put following gist to ~/Library/LaunchAgents, and then run: launchctl load /Users/your_name/Library/LaunchAgents/com.yourcompany.autossh.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>OnDemand</key>
<false/>
<key>KeepAlive</key>
<true/>
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@coryt
coryt / url.js
Created September 10, 2015 14:13
PullRequest Template
javascript:(function() {var e = document.getElementById('pull_request_body');if (e) {e.value += '#### What\'s this PR do?\n\n#### Checklist\n- [ ] Code reviewed @erewh0n @Dkane1 @richardpenner @coryt\n- [ ] Unit/Integration Tests Written/Passing\n\n#### Mongo Index Changes?\n\n#### How should this be manually tested?\n\n#### Related Issues/Stories?\n\n#### Screenshots (if appropriate)\n\n#### Questions:\n- Do migrations need to be ran?\n- Are there any additional deployment instructions/requirements?';}})();
@coryt
coryt / url.js
Last active September 10, 2015 14:15
Issues Template
javascript:(function() {var e = document.getElementById('issue_body');if (e) {e.value += '#### What\'s the problem?\n\n#### Steps to reproduce?\n* Account used: \n* Feature (home feed, case detail, login, etc):\n\n#### Screenshots (if appropriate)\n\n';}})();
@coryt
coryt / install-teamcity.md
Last active September 17, 2015 07:41 — forked from sandcastle/install-teamcity.md
Install TeamCity 9.1.1 on Ubuntu with Nginx