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 subscription = new Subscriber().CreateSubscription().ToServiceMessages<IEchoService>(); | |
| subscription.MessageReceived += message => { | |
| Console.Writeline(x.Body); | |
| }; | |
| subscription.Start(); |
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
| Chatham.Libraries.Ioc.IocContainer.Instance.Bind<IStatsClient>(() => new StatsdClient()); | |
| Chatham.Libraries.Ioc.IocContainer.Instance.Bind<ICacheClient>(() => new MemcachedClient()); | |
| var typedCache = Chatham.Libraries.Ioc.IocContainer.Instance.Get<TypedCache<MyObject>>(); |
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
| public class TypedCache<T> { | |
| private readonly Chatham.Libraries.Stats.Api.IStatsClient _statsClient; | |
| private readonly Chatham.Libraries.Caching.Api.ICacheClient _cacheClient; | |
| public TypedCache(Chatham.Libraries.Stats.Api.IStatsClient statsClient, Chatham.Libraries.Caching.Api.ICacheClient cacheClient) { | |
| this._statsClient = statsClient; | |
| this._cacheClient = cacheClient; | |
| } | |
| ... |
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
| public class TypedCache<T> { | |
| private readonly Chatham.Libraries.Stats.IStatsClient _statsClient; | |
| private readonly Chatham.Libraries.Caching.ICacheClient _cacheClient; | |
| public TypedCache() { | |
| this._statsClient = new Chatham.Libraries.Stats.StatsdClient(); | |
| this._cacheClient = new Chatham.Libraries.MemcachedClient.MemcachedClient(); | |
| } | |
| ... |
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 request = require('request') | |
| , querystring = require('querystring'); | |
| module.exports = function ChatterAuth() { | |
| this.environment = process.env.SALESFORCE_ENV; | |
| this.client_id = process.env.SALESFORCE_CLIENT_ID; | |
| this.client_secret = process.env.SALESFORCE_CLIENT_SECRET; | |
| this.oauth_callback_uri = process.env.SALESFORCE_OAUTH_CALLBACK_URI; | |
| this.redirectToLogin = function(req, res) { |
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
| function hello(name) { | |
| this.name = name; | |
| this.sayIt = function(callback) { | |
| var self = this; | |
| setTimeout(function() { | |
| callback("Hello " + self.name); | |
| }, Math.random()*1000); | |
| }; | |
| }; |
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
| ============================================================== | |
| MODULE :: hello.js | |
| ============================================================== | |
| module.exports = function hello(name) { | |
| this.name = name; | |
| this.sayIt = function() { | |
| return "Hello " + this.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
| function getQuerystringParamByName(name) { | |
| name = name.replace(/[\[]/, '\\\[').replace(/[\]]/, '\\\]'); | |
| var regexS = '[\\?&]' + name + '=([^&#]*)' | |
| , regex = new RegExp(regexS) | |
| , results = regex.exec(window.location.search); | |
| if(!results) { | |
| return ''; | |
| } |
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
| function getTimeSince(start, end) { | |
| var msSince = (end - start); | |
| var msInDay = 24*60*60*1000 | |
| , msInHour = 60*60*1000 | |
| , msInMinute = 60*1000 | |
| , msInSecond = 1000; | |
| if (msSince > msInDay) { // greater than one day | |
| return parseInt(msSince / msInDay).toString() + 'd Ago'; |
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
| tsavery@tangialt01:~/github/timsavery/nodephilly-raffle$ jitsu env list | |
| info: Welcome to Nodejitsu | |
| info: It worked if it ends with Nodejitsu ok | |
| info: Executing command env list | |
| info: Listing all environment variables for: nodephilly-raffle | |
| data: { | |
| data: USER_KEY: 833786748121301400000, | |
| data: EVENTBRITE_APP_KEY: 'xxxx', | |
| data: SUBDOMAIN: 'nodephillyraffle', | |
| data: NODE_ENV: 'production', |