Skip to content

Instantly share code, notes, and snippets.

View app.js
var config = {
"database": {
"connection": "mongodb://localhost/scrapService"
},
"cookieSecret": "EhAIj3NmtJ1sem5StHXV0Mk"
};
require("./user")
var express = require('express')
, mongoose = require('mongoose')
, User = mongoose.models["User"]
@aheritier
aheritier / setMaven.sh
Created May 29, 2013
Script to switch between various Maven versions (One day perhaps we may have a renv, jenv, like ...) Works on MacOs Put your Maven installations under $MVN_VERSIONS_DIRECTORY
View setMaven.sh
#!/bin/bash
MVN_VERSIONS_DIRECTORY="/Users/arnaud/Applications/"
MVN_DIRECTORY_TEMPLATE="apache-maven-"
versions=`ls -1 ${MVN_VERSIONS_DIRECTORY} | grep ${MVN_DIRECTORY_TEMPLATE}'[2-9].[0-9]' | sed 's/^.*maven-//g'`
echo -e "\033[1;32mAvailable Versions:\033[0m " $versions
if [ "$1" == "" ]; then
exit
fi
@radekg
radekg / install_chef_server_11_ubuntu12.04.sh
Last active Dec 18, 2015
Install Chef Server 11 on Ubuntu 12.04 - complete
View install_chef_server_11_ubuntu12.04.sh
# run as root:
sudo bash
CHEF_HOSTNAME='...'
CHEF_VERSION='11.0.8'
UBUNTU_VERSION='12.04'
# update, upgrade, install packages
apt-get --force-yes -y update
apt-get --force-yes -y dist-upgrade
View lab-docker-instructions.md

If you plan to attend this workshop in a conference, as network availibility is often flaky, please check you have the following :

  • A laptop + cord
  • Install docker 1.11
    • Install with Toolbox for windows or for Mac
    • If you haven't done it already, register for the Docker for desktop beta at https://beta.docker.com, and give us your hub account name during the session we can probably do something for you.
  • Test your docker installation works fine
    • docker run hello-world and check you see the welcome message
    • docker run -p 8080:80 nginx and open your browser to your machine on port 8080 and check you see nginx default page.
  • Warm up your local docker machine with the following images :
    • docker pull dockerdemos/lab-web
@krosenvold
krosenvold / gist:2508909
Created Apr 27, 2012
Try this on your multimodule maven build and watch the performance difference !
View gist:2508909
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
.....
<dependencies>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-javac</artifactId>
<version>1.8.6</version>
</dependency>
@arthurtsang
arthurtsang / DynamicServiceActivator.java
Created Mar 29, 2013
Create a Spring Integration Channel programatically and register that as a Spring bean
View DynamicServiceActivator.java
private SubscribableChannel createInputChannel(String inputChannelName) {
PublishSubscribeChannel channel = new PublishSubscribeChannel();
channel.setBeanName(inputChannelName);
channel.setBeanFactory(applicationContext);
//channel.setApplySequence(true);
((ConfigurableApplicationContext)applicationContext).getBeanFactory().registerSingleton(inputChannelName, channel);
return channel;
}
@whiteinge
whiteinge / fabfile.py
Created Nov 13, 2009
Example fabric script with VirtualBox automation
View fabfile.py
# -*- coding: utf-8 -*-
"""MyCompany Fabric script.
* Deploy code
* Set up a local development environment
There are two ways to deploy the myrepo code:
1. :func:`deploy` will do a full virtualenv installation/update and expand a
tarball of the specified git revision (defaults to HEAD) to a timestamped
View wordpress.rb
require 'rubygems'
require 'sequel'
require 'fileutils'
# NOTE: This converter requires Sequel and the MySQL gems.
# The MySQL gem can be difficult to install on OS X. Once you have MySQL
# installed, running the following commands should work:
# $ sudo gem install sequel
# $ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
@jtimberman
jtimberman / gist:3088517
Last active Feb 7, 2018
Replace $VAGRANTBOX with box names that should be repackaged with updates. Don't specify it for up, ssh, and package if you're not using a multi-VM vagrantfile
View gist:3088517
% vagrant up --no-provision $VAGRANTBOX
% vagrant ssh $VAGRANTBOX
vagrant$ wget -O - http://opscode.com/chef/install.sh | sudo bash
vagrant$ rm /tmp/chef*{rpm,deb}
vagrant$ exit
% vagrant package $VAGRANTBOX
% rm -rf ~/.vagrant.d/boxes/$VAGRANTBOX
% vagrant box add $VAGRANTBOX package.box
@devudilip
devudilip / SUBLIME TEXT2 INSTALLATION
Created Oct 22, 2011
HOW TO INSTALL SUBLIME TEXT 2 ON UBUNTU 11.10
View SUBLIME TEXT2 INSTALLATION
#BECOME SUPER USER#
sudo -i
#add sublime to repository#
add-apt-repository ppa:webupd8team/sublime-text-2
#update#