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
| #!/usr/bin/env bash | |
| f() { | |
| /etc/init.d/chef-expander $1 | |
| /etc/init.d/chef-solr $1 | |
| /etc/init.d/chef-server $1 | |
| /etc/init.d/chef-server-webui $1 | |
| } | |
| if [ "$1" == "start" ]; then | |
| f start | |
| elif [ "$1" == "stop" ]; then |
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
| import javax.script.*; | |
| public class GroovyScripting { | |
| public static void main(String[] args) throws Exception { | |
| ScriptEngine engine = new ScriptEngineManager().getEngineByName("groovy"); | |
| Bindings bindings = engine.getBindings(ScriptContext.ENGINE_SCOPE); | |
| bindings.put("counter", 0); | |
| bindings.put("args", new String[] {"hello", "world"}); | |
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
| #!/usr/bin/env coffee | |
| express = require "express" | |
| jade = require "jade" | |
| assets = require "connect-assets" | |
| stylus = require "stylus" | |
| nib = require "nib" | |
| fs = require "fs" | |
| #routes = require './routes' | |
| #user = require './routes/user' | |
| http = require 'http' |
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
| import System.IO | |
| main = do | |
| handle <- openFile "haiku.txt" ReadMode | |
| contents <- hGetContents handle | |
| putStr contents | |
| hClose handle |
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
| #!/usr/bin/env bash | |
| \curl -L https://get.rvm.io | bash -s stable | |
| source ~/.rvm/scripts/rvm | |
| for e in readline iconv curl openssl zlib autoconf ncurses pkgconfig gettext glib mono llvm libxml2 libxslt libyaml; do rvm pkg install $e; done | |
| rvm install 1.9.3 --with-openssl-dir=$HOME/.rvm/usr | |
| gem install --no-ri --no-rdoc chef |
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
| mkdeferred = (wrapped, func)-> | |
| -> | |
| dfd = $.Deferred() | |
| args = _.flatten [wrapped, dfd, [].slice.apply arguments] | |
| func.apply null, args | |
| dfd.promise() |
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
| ### | |
| Example: retrieving all links of yahoo.com | |
| $ npm up | |
| $ node_modules/.bin/coffee example.coffee | |
| ### | |
| require "./node-jquery" | |
| $.ajax | |
| url: 'http://www.yahoo.com' | |
| success: (res)-> | |
| for e in $(res).find("a") |
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
| require "kramdown" | |
| require "haml" | |
| task :default => :doc | |
| task :doc do | |
| bootstrap = "https://raw.github.com/cdnjs/cdnjs/master/ajax/libs/twitter-bootstrap/2.1.1/css/bootstrap.min.css" | |
| responsive = "https://github.com/cdnjs/cdnjs/blob/master/ajax/libs/twitter-bootstrap/2.1.1/css/bootstrap-responsive.min.css" | |
| jquery = "http://code.jquery.com/jquery-1.8.2.min.js" | |
| coffeescript = "http://coffeescript.org/extras/coffee-script.js" |
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
| args = | |
| markdown: (path)-> require("markdown-js").parse fs.readFileSync(path).toString() | |
| app.get "/", (req, res)-> res.render 'index', args | |
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
| args = | |
| markdown: (path)-> require("markdown-js").parse fs.readFileSync(path).toString() | |
| app.get "/", (req, res)-> res.render 'index', args | |