This file contains 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
// | |
// Crude node.js longpoll example via a simple message queue | |
// | |
//-------------------- | |
// app.js | |
//-------------------- | |
var queue = require('./queue/messagequeue'); | |
app.get('/messages/:queueName/:lastMsgId', queue.getMessages); | |
app.post('/messages/:queueName', queue.postMessages); |
This file contains 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
/** | |
1. Install the Stylish(https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe?hl=en) extension for Chrome. | |
2. Open up extension options and paste the whole CSS mentioned below. | |
3. Specify the domain name to be `github.com`. | |
4. Add a title and save. | |
*/ | |
.header { | |
padding-top: 10px; | |
padding-bottom: 10px; |
This file contains 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 UIKit | |
extension UICollectionReusableView { | |
/// The default implementation of `defaultIdentifier()` uses `NSStringFromClass(class)` rather than `String(class)` so that the module name is includded. | |
/// The hope being that this makes collisions unlikely making it unnnecessary to provide your own implementations. | |
public class func defaultIdentifier() -> String { | |
return NSStringFromClass(self) | |
} | |
} |
This file contains 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
/* Find column in all databases */ | |
DECLARE @db_name varchar(100), | |
@col_name varchar(100), | |
@sql_statement nvarchar(MAX) | |
-- column you are looking for | |
SET @col_name = 'PLANNED_SAMPLE_ID' | |
-- fill cursor with database names |
This file contains 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
# This is a manifest that describes "platform" agents that we run on every instance. | |
# It includes auxilary services that work alongside with the application containers | |
# to provide logging and monitoring. | |
# | |
# This file looks a bit tough, but that's what happens when you meet the reality. | |
# We have also pruned it a bit to remove our company specifics. | |
# | |
# You may notice "env", "role" and "track" variables. We specify them as EC2 instance | |
# tags and pass them to rocker-compose on every run. This allows us to distinguish | |
# instances and do basic service discovery and A/B testing. |
This file contains 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
/// | |
/// Extention functions for UICollectionViewController | |
/// | |
extension UICollectionViewController { | |
/// Allows easy access to a collection view controller's refrsh control the same way as in a table view controller. | |
var refreshControl: UIRefreshControl? { | |
get { | |
return collectionView?.viewWithTag(140412014669856) as? UIRefreshControl | |
} | |
set { |
This file contains 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 import | |
*/ | |
var express = require('express'); | |
/** | |
* Port the server listens on | |
*/ | |
var port = 3000; |
This file contains 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
# install chef-solo one line ! | |
curl -L https://www.opscode.com/chef/install.sh | bash | |
# cookbooks have their rep: check the dir name == cookbook name | |
mkdir -p /opt/cookbooks | |
git clone https://github.com/hw-cookbooks/graphite | |
git clone https://github.com/opscode-cookbooks/apache2.git | |
git clone https://github.com/opscode-cookbooks/python.git | |
git clone https://github.com/opscode-cookbooks/runit.git | |
git clone https://github.com/opscode-cookbooks/memcached.git |
This file contains 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 'lodash' | |
Promise = require 'bluebird' | |
Promise.retry = (action, options = {}) -> | |
_.merge | |
max: 5 | |
backoff: 500 | |
, options | |
d = Promise.defer() |
This file contains 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
. (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1") | |
If (Test-Path "cloud_package.cspkg") { | |
Remove-Item "cloud_package.cspkg" -Force | |
} | |
cd "WebRole" | |
iex "git reset --hard origin/master" | |
iex "git pull" | |
cmd /C "rmdir /S /Q node_modules" |