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
[~/Sites/app] cucumber --drb | |
Using the default profile... | |
Disabling profiles... | |
Exception encountered: #<RuntimeError: Application has been already initialized.> | |
backtrace: | |
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/application.rb:91:in `initialize!' | |
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/cucumber-rails-1.0.2/lib/cucumber/rails/application.rb:15:in `initialize!' | |
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `method_missing' | |
/Users/pma/Sites/app/config/environment.rb:5:in `<top (required)>' | |
/Users/pma/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `load' |
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
object FizzBuzz extends App { | |
val nones = Stream.continually(None) | |
val fizzes: Stream[Option[String]] = nones.take(2) ++ Some("Fizz") #:: fizzes | |
val buzzes: Stream[Option[String]] = nones.take(4) ++ Some("Buzz") #:: buzzes | |
for (((fizz, buzz), n) <- fizzes zip buzzes zip (1 to 100)) { | |
println(fizz.map(_ + buzz.getOrElse("")).orElse(buzz).getOrElse(n)) | |
} |
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
#!/bin/sh | |
sudo apt-get install git mono-mcs mono-gmcs autoconf libtool g++ libglib2.0-cil-dev libgtk2.0-cil-dev libglade2.0-cil-dev libgnome2.0-cil-dev libgconf2.0-cil-dev | |
mkdir mono | |
cd mono | |
git clone https://github.com/mono/mono.git | |
git clone https://github.com/mono/monodevelop.git | |
git clone https://github.com/mono/xsp.git | |
git clone https://github.com/mono/mono-addins.git | |
cd mono |
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
# ~/.tmux.conf | |
# | |
# See the following files: | |
# | |
# /opt/local/share/doc/tmux/t-williams.conf | |
# /opt/local/share/doc/tmux/screen-keys.conf | |
# /opt/local/share/doc/tmux/vim-keys.conf | |
# | |
# URLs to read: | |
# |
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
//returns a promise that resolves after a time | |
function wait(time){ | |
return new Promise(function(resolve){ | |
window.setTimeout(resolve,time); | |
}); | |
} | |
//a function that, if called with just a time, | |
//returns a function that will return a wait... | |
//that resolves with whatever value it was given |
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
// groupcities.js | |
// An alternative solution to: | |
// https://dev.to/albinotonnina/how-to-lose-a-it-job-in-10-minutes-35pi | |
// | |
// Given an array of city names, group the ones that are rotations of | |
// each other together. e.g.: | |
// | |
// input: ['Tokyo', 'London', 'Rome', 'Donlon', 'Kyoto', 'Paris'] | |
// output: | |
// [ |
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
$username = "insert_username_here" | |
$password = ConvertTo-SecureString "insert_password_here" -AsPlainText -Force | |
$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username,$password | |
$session = New-PSSession "insert_hostname_here" -Credential $credential | |
Invoke-Command -Session $session -ScriptBlock { | |
Set-ExecutionPolicy RemoteSigned | |
Import-Module WebAdministration | |
New-Item iis:\Sites\%teamcity.build.branch%.insert_local_name_here -bindings @{protocol="http";bindingInformation=":80:%teamcity.build.branch%.insert_local_name_here"} -physicalPath c:\inetpub\wwwroot\%teamcity.build.branch%.insert_local_name_here | |
Set-ItemProperty 'IIS:\Sites\%teamcity.build.branch%.insert_local_name_here' ApplicationPool "ASP.NET v4.0" |
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
using System; | |
namespace Virtlink | |
{ | |
/// <summary> | |
/// Executes a particular piece of code based on the type of the argument. | |
/// </summary> | |
/// <example> | |
/// Usage example: | |
/// <code> |
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
#!/bin/bash | |
# Description: Using Docker (requires docker to be installed http://www.docker.io/gettingstarted/ ), spawn a postgresql instance and a dynamically configured treeio instance | |
# Also requires postgresql client tools http://www.postgresql.org/download/linux/ubuntu/ | |
# Run chmod +x to make this file executable then run it: ./docker_create_treeio.sh | |
# Author: Adam Awan | |
# Email: adam@tree.io | |
# Set the port to forward for Tree.io | |
TREEIO_PORT="80" |
OlderNewer