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 | |
| namespace Acme\UserBundle\Entity; | |
| use Doctrine\ORM\EntityRepository; | |
| use Doctrine\ORM\Query\Expr; | |
| /** | |
| * UserRepository | |
| * |
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
| #!/bin/bash | |
| # | |
| # Carbon (part of Graphite) | |
| # | |
| # chkconfig: 3 50 50 | |
| # description: Carbon init.d | |
| . /etc/rc.d/init.d/functions | |
| prog=carbon | |
| RETVAL=0 |
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 | |
| /** | |
| * Recognizes mData sent from DataTables where dotted notations represent a related | |
| * entity. For example, defining the following in DataTables... | |
| * | |
| * "aoColumns": [ | |
| * { "mData": "id" }, | |
| * { "mData": "description" }, | |
| * { "mData": "customer.first_name" }, | |
| * { "mData": "customer.last_name" } |
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/sh | |
| ### BEGIN INIT INFO | |
| # Provides: thin | |
| # Required-Start: $local_fs $remote_fs | |
| # Required-Stop: $local_fs $remote_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: S 0 1 6 | |
| # Short-Description: thin initscript | |
| # Description: thin | |
| ### END INIT INFO |
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
| /* | |
| Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod | |
| May contain errors where latitude and longitude are off. Use at own non-validated risk. | |
| */ | |
| SET NAMES utf8; | |
| SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; | |
| DROP TABLE IF EXISTS postcodes_geo; |
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
| import javax.annotation.Nonnull; | |
| import android.app.Activity; | |
| import android.app.Service; | |
| import android.support.v4.app.Fragment; | |
| import android.content.Context; | |
| /** | |
| * <p>Retrieves the {@link dagger.ObjectGraph} and injects dependencies.</p> | |
| * @author Dandré Allison |
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/bash | |
| # mongos - Startup script for mongos | |
| # chkconfig: 35 85 15 | |
| # description: Mongo is a scalable, document-oriented database. | |
| # processname: mongos | |
| # config: /etc/mongos.conf | |
| # pidfile: /var/run/mongo/mongos.pid |
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
| var collectionNames = db.getCollectionNames(), stats = []; | |
| collectionNames.forEach(function (n) { stats.push(db[n].stats()); }); | |
| stats = stats.sort(function(a, b) { return b['size'] - a['size']; }); | |
| for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['size'] + " (" + stats[c]['storageSize'] + ")"); } |
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
| //TODO in this script | |
| //1. Add board id in url used in TrelloAPI method (line xx | |
| //2. Add your email in sendChartsByEmail | |
| //3. Add your Trello keys from https://trello.com/1/appKey/generate to authorizeTrello | |
| //4. Setup daily trigger in script editor that runs TrelloAPI() | |
| //5. Run once in google apps script editor to authorize trello for access | |
| //6. Lookup values and aggValues are hardcoded to the labels I use in Trello | |
| // | |
| //In the Trello board use scrum for trello syntax (http://scrumfortrello.com/) | |
| //Example title: <name of task> (estimate hours) [work delivered in hours] |