Skip to content

Instantly share code, notes, and snippets.

View intinig's full-sized avatar

Giovanni Intini intinig

View GitHub Profile
;; Apply shell environment to emacs
(require 'cl)
(defun env-line-to-cons (env-line)
"Convert a string of the form \"VAR=VAL\" to a cons cell containing (\"VAR\" . \"VAL\")."
(if (string-match "\\([^=]+\\)=\\(.*\\)" env-line)
(cons (match-string 1 env-line) (match-string 2 env-line))))
(defun interactive-env-alist (&optional shell-cmd env-cmd)
"Launch /usr/bin/env or the equivalent from a login shell, parsing and returning the
environment as an alist."
Exception: Error loading object '/usr/local/Cellar/io/2011.09.12/lib/io/addons/Regex/_build/dll/libIoRegex.dylib': 'dlopen(/usr/local/Cellar/io/2011.09.12/lib/io/addons/Regex/_build/dll/libIoRegex.dylib, 10): Library not loaded: /tmp/homebrew-io-2011.09.12-enVI/stevedekorte-io-23afbcc/buildroot/addons/Range/_build/dll/libIoRange.dylib
Referenced from: /usr/local/Cellar/io/2011.09.12/lib/io/addons/Regex/_build/dll/libIoRegex.dylib
Reason: image not found'
for page in ctags.1 ebrowse.1 emacs.1 emacsclient.1 etags.1 grep-changelog.1 rcs-checkin.1; do \
(cd ${thisdir}; \
/usr/local/bin/ginstall -c -m 644 /private/tmp/homebrew-emacs-HEAD-oYMj/doc/man/${page} /usr/local/Cellar/emacs/HEAD/share/man/man1/${page}; \
chmod a+r /usr/local/Cellar/emacs/HEAD/share/man/man1/${page}; \
if [ -n "yes" ] && [ -n "/usr/bin/gzip" ]; then \
rm -f /usr/local/Cellar/emacs/HEAD/share/man/man1/${page}.gz; \
/usr/bin/gzip -9n /usr/local/Cellar/emacs/HEAD/share/man/man1/${page}; \
else true; fi ); \
done
not_if do
nginx_force_recompile == false &&
begin
node.automatic_attrs['nginx']['version'] == node['nginx']['version'] &&
node.automatic_attrs['nginx']['configure_arguments'].sort == configure_flags.sort
rescue
puts node.automatic_attrs['nginx'].inspect
raise
end
end
(defun sass-compile-buffer ()
(interactive)
(mark-whole-buffer)
(shell-command-on-region (region-beginning) (region-end) "sass" "*SASS Output*" nil "SASS Error*" t))
@intinig
intinig / haml.rake
Created August 8, 2012 14:25
HamlWatcher
namespace :haml do
desc "Watch the site's HAML templates and recompile them when they change"
task :watch do
require File.join(File.dirname(__FILE__), 'lib', 'haml_watcher')
HamlWatcher.watch ENV['SOURCE'], ENV['DEST']
end
end
def locate_config_value(key)
key = key.to_sym
Chef::Config[:knife][key] || config[key]
end
def initialize
source = Backend.get('xml/menu.xml')
@xml_doc = Nokogiri::XML(source)
puts @xml.doc
puts Nokogiri::XML(source)
end
[2012-11-13T13:08:26+00:00] INFO: Run List is [role[vdp-web], role[vdp-db], role[blog-vdp], recipe[basic-conf::s3-backup]]
[2012-11-13T13:08:26+00:00] INFO: Run List expands to [basic-conf, apache2, apache2::vhost, mysql::client, mysql::ruby, php, php::module_apc, php::module_memcache, php::module_mysql, php::module_ioncube, php::module_gd, php::module_mcrypt, mysql::server_ec2, basic-conf::s3-backup]
# Logfile created on 2012-11-13 13:09:22 +0000 by logger.rb/31641
[2012-11-13T13:09:22+00:00] INFO: *** Chef 10.16.2 ***
[2012-11-13T13:09:26+00:00] INFO: Run List is [role[vdp-web], role[vdp-db], role[blog-vdp], recipe[basic-conf::s3-backup]]
[2012-11-13T13:09:26+00:00] INFO: Run List expands to [basic-conf, apache2, apache2::vhost, mysql::client, mysql::ruby, php, php::module_apc, php::module_memcache, php::module_mysql, php::module_ioncube, php::module_gd, php::module_mcrypt, mysql::server_ec2, basic-conf::s3-backup]
[2012-11-13T13:09:27+00:00] INFO: Starting Chef Run for i-f88906b3
[2012-11-13T13:09:27+00:00] INFO: Running start handlers
[2012-11-13T13:09:27+00:00] INFO: Start handlers complete.
[2012-11-13T13:09:29+00:00] INFO: Loading cookbooks [apache2, apt, aws, basic-conf, build-essential, chef_handler, database, logrotate, mysql, openssl, php, postgresql, reboot-handler, ubuntu, xfs, xml]
[2012-11-13T13:09:29+00:00] WARN: Setting attributes without specifying a precedence is deprecated and will be
r