This file contains hidden or 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
| -- 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%' |
This file contains hidden or 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
| --- | |
| # ^^^ YAML documents must begin with the document separator "---" | |
| # | |
| #### Example docblock, I like to put a descriptive comment at the top of my | |
| #### playbooks. | |
| # | |
| # Overview: Playbook to bootstrap a new host for configuration management. | |
| # Applies to: production | |
| # Description: | |
| # Ensures that a host is configured for management with Ansible. |
This file contains hidden or 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
| <?php | |
| /** | |
| * Converts any valid PHP callable into a Closure. Requires PHP 5.4.0+. | |
| * | |
| * The ramifications of this are many, but basically it means that any function | |
| * or method can be converted into a Closure, bound to another scope, and | |
| * executed easily. Works properly even with private methods. | |
| * | |
| * - On success, returns a Closure corresponding to the provided callable. | |
| * - If the parameter is not callable, issues an E_USER_WARNING and returns a |
This file contains hidden or 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
| <?php | |
| class AnObj | |
| { | |
| protected $methods = array(); | |
| protected $properties = array(); | |
| public function __construct(array $options) | |
| { | |
This file contains hidden or 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
| #To install: | |
| # | |
| #In your git configuration (for instance, .git/config to do it at the project level), add: | |
| # | |
| #[merge "json_merge"] | |
| # name = A custom merge driver for json files | |
| # driver = coffee json_merge.coffee %O %A %B | |
| # recursive = binary | |
| # | |
| #In your project's .gitattributes file, add something like: |
This file contains hidden or 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
| #!/bin/env python | |
| """mergelog | |
| This is a custom merge driver for git. It should be called from git | |
| with a stanza in .git.config like this: | |
| [merge "mergelog"] | |
| name = A custom merge driver for my log.txt file. | |
| driver = ~/scripts/mergelog %O %A %B %L | |
| recursive = binary |