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
| # | |
| # bash completion support for core Git. | |
| # | |
| # Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org> | |
| # Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
| # Distributed under the GNU General Public License, version 2.0. | |
| # | |
| # The contained completion routines provide support for completing: | |
| # | |
| # *) local and remote branch names |
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
| // a solution to http://blog.abhiomkar.in/2010/07/03/javascript-code-challenge-by-dropbox-team/ | |
| // | |
| var countdown = function(num){ | |
| for (var i = 0; i <= num; i += 1) { | |
| (function(i){ setTimeout(function(){ alert(num - i); }, i * 1000); })(i); | |
| } | |
| } | |
| countdown(5); |
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
| # Offering alternative Chef + Vagrant Riak cluster setup to the following blog post at basho: | |
| # http://blog.basho.com/2011/02/04/creating-a-local-riak-cluster-with-vagrant-and-chef/ | |
| # Assumes Vagrant 0.7.0+ and VirtualBox 4.0+ | |
| # Now you should be able to launch your X (where X=4 in this case) vagrant VMs with the following: | |
| # % vagrant up db1 | |
| # % vagrant up db2 | |
| # % vagrant up db3 | |
| # % vagrant up db4 |
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
| ######################################################################## | |
| ### Rakefile for encrypted passwords | |
| ######################################################################## | |
| # | |
| # Here's a little Rakefile to manage your encrypted password file! It's | |
| # really easy to use: | |
| # | |
| # 1) put the email addresses of the keys you want in AUTHORIZED_USERS | |
| # 2) create a passwords.txt (and ignore it in your SCM) | |
| # 3) run `rake passwords:encrypt` |
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
| <fieldType name="text" class="solr.TextField" omitNorms="false"> | |
| <analyzer> | |
| <!-- <tokenizer class="solr.StandardTokenizerFactory"/> --> | |
| <tokenizer class="solr.WhitespaceTokenizerFactory"/> | |
| <filter class="solr.StandardFilterFactory"/> | |
| <filter class="solr.LowerCaseFilterFactory"/> | |
| <!-- own attempt to use synonyms --> | |
| <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false"/> | |
| </analyzer> | |
| </fieldType> |
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
| # This is a fragment of code from action_controller/request.rb that handles sessions. | |
| # (this is Rails 2.3.11 if that matters). | |
| # It is obvious from the first method that a session is expected to be a hash. | |
| def session | |
| @env['rack.session'] ||= {} | |
| end | |
| def session=(session) #:nodoc: |
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
| // Place your application-specific JavaScript functions and classes here | |
| // This file is automatically included by javascript_include_tag :defaults | |
| // | |
| if(!window.jq && window.jQuery){ | |
| var jq = jQuery; | |
| }; | |
| if(!window.App){ | |
| window.App = {}; |
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
| diff --git a/lib/middleware/visitor.rb b/lib/middleware/visitor.rb | |
| new file mode 100644 | |
| index 0000000..fdfb96d | |
| --- /dev/null | |
| +++ b/lib/middleware/visitor.rb | |
| @@ -0,0 +1,100 @@ | |
| +module Middleware | |
| + class Visitor | |
| + class Node < Struct.new(:id, :name) | |
| + end |
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
| # install git | |
| sudo apt-get install g++ curl libssl-dev apache2-utils | |
| sudo apt-get install git-core | |
| # download the Node source, compile and install it | |
| git clone https://github.com/joyent/node.git | |
| cd node | |
| ./configure | |
| make | |
| sudo make install | |
| # install the Node package manager for later use |
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
| # a daemon method that blocks until the grandchild is ready | |
| # | |
| # sending the pid up a pipe (grandchild -> child -> parent) | |
| # | |
| def daemon(options = {}, &block) | |
| # setup | |
| # | |
| raise(ArgumentError, 'no block!') unless block | |
| chdir = options[:chdir] || options['chdir'] || '.' |