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
| namespace Sagas | |
| { | |
| using System; | |
| using System.Collections.Generic; | |
| class Program | |
| { | |
| static ActivityHost[] processes; |
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
| /* | |
| modified from original source: https://bitbucket.org/mattkotsenas/c-promises/overview | |
| */ | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| namespace Promises |
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
| App.module("FooModule.Bar", { | |
| startWithApp: false, | |
| define: function() { | |
| // Code of submodule | |
| } | |
| }); |
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
| express = require 'express' | |
| gracefullyExiting = false | |
| app = express.createServer() | |
| app.use (req, res, next) -> | |
| return next() unless gracefullyExiting | |
| res.setHeader "Connection", "close" | |
| res.send 502, "Server is in the process of restarting." |
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
| require.config({ | |
| baseUrl: '/backbone-tests/', | |
| paths: { | |
| 'jquery' : '/app/libs/jquery', | |
| 'underscore' : '/app/libs/underscore', | |
| 'backbone' : '/app/libs/backbone', | |
| 'mocha' : 'libs/mocha', | |
| 'chai' : 'libs/chai', | |
| 'chai-jquery' : 'libs/chai-jquery', | |
| 'models' : '/app/models' |
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
| // -------------------------------------------------- | |
| // Flexbox LESS mixins | |
| // The spec: http://www.w3.org/TR/css3-flexbox | |
| // -------------------------------------------------- | |
| // Flexbox display | |
| // flex or inline-flex | |
| .flex-display(@display: flex) { | |
| display: ~"-webkit-@{display}"; | |
| display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox |
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
| MyApp.module('MyApp.SomeBuilder', function(SomeBuilder, App, Backbone, Marionette, $, _){ | |
| 'use strict'; | |
| // Controller | |
| // ---------- | |
| SomeBuilder.Controller = Marionette.Controller.extend({ | |
| initialize: function(options){ | |
| this.navbarRegion = options.navbarRegion; | |
| this.mainRegion = options.mainRegion; |
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
| I'm a Rubyist with a lot of admiration for Python. Both languages are | |
| similar (in the grand scheme of things) and each has huge pros and cons. | |
| Python does not click for me in the same way as Ruby does not | |
| click for perhaps the majority of programmer-kind. German doesn't click | |
| for me either and 100m+ people speak that ;-) But I recently saw an | |
| example of WHY Python taxes my Ruby brain a little. | |
| I found some code at http://lukeplant.me.uk/blog/posts/why-learning-haskell-python-makes-you-a-worse-programmer/: |