Skip to content

Instantly share code, notes, and snippets.

View tmtk75's full-sized avatar

Tomotaka Sakuma tmtk75

View GitHub Profile
file_cache_path "/tmp/chef-solo"
cookbook_path "/tmp/chef-solo/cookbooks"
{
"chef_server": {
"server_url": "http://localhost:4000",
"webui_enabled": true
},
"yum": { "epel_release": "6-7" },
"run_list": [ "recipe[chef-server::rubygems-install]" ]
}
@tmtk75
tmtk75 / express-stylus.html
Created May 23, 2012 01:36 — forked from bentruyman/express-stylus.html
Using Stylus Middleware with Express
<!doctype html>
<html lang="en">
<head>
<title>My Web Page</title>
<meta charset="utf-8">
<link href="/stylesheets/main.css" rel="stylesheet">
</head>
<body>
</body>
</html>
args =
markdown: (path)-> require("markdown-js").parse fs.readFileSync(path).toString()
app.get "/", (req, res)-> res.render 'index', args
args =
markdown: (path)-> require("markdown-js").parse fs.readFileSync(path).toString()
app.get "/", (req, res)-> res.render 'index', args
@tmtk75
tmtk75 / gist:3816634
Created October 2, 2012 06:07
Rakefile to convert READMD.md with kramdown and haml including twitter bootstrap and jquery
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"
###
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")
mkdeferred = (wrapped, func)->
->
dfd = $.Deferred()
args = _.flatten [wrapped, dfd, [].slice.apply arguments]
func.apply null, args
dfd.promise()
#!/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
import System.IO
main = do
handle <- openFile "haiku.txt" ReadMode
contents <- hGetContents handle
putStr contents
hClose handle