Skip to content

Instantly share code, notes, and snippets.

View tonini's full-sized avatar
💭
I may be slow to respond.

Samuel Tonini tonini

💭
I may be slow to respond.
View GitHub Profile
subject do
Class.new do
include ActionView::Helpers::CacheHelper
end.new
end
require 'formula'
require 'hardware'
class Postgresql <Formula
homepage 'http://www.postgresql.org/'
url 'http://ftp2.uk.postgresql.org/sites/ftp.postgresql.org/source/v8.4.7/postgresql-8.4.7.tar.bz2'
md5 '4771d4ae4fd9e7e9b92c22253517508d'
depends_on 'readline'
depends_on 'libxml2' if MACOS_VERSION < 10.6 # Leopard libxml is too old
require 'formula'
require 'hardware'
class Postgresql <Formula
homepage 'http://www.postgresql.org/'
url 'http://ftp2.uk.postgresql.org/sites/ftp.postgresql.org/source/v8.4.7/postgresql-8.4.7.tar.bz2'
md5 '689397187bb1dfe9b5cbde99538311c3'
depends_on 'readline'
depends_on 'libxml2' if MACOS_VERSION < 10.6 # Leopard libxml is too old
(defun tonini-ruby-execute-file ()
"Executes the current Ruby file."
(interactive)
(if rspec-use-rvm
(rvm-activate-corresponding-ruby))
(setq current-file (buffer-file-name))
(if (and current-file (file-exists-p current-file))
(if (string-match "\\.rb$" current-file)
(compile (concat "ruby -w " current-file))
(message "%s is not a valid ruby file." current-file))
@tonini
tonini / jasmine-node.el
Created June 24, 2012 20:09
Little helper for running jasmine-node from emacs
(defvar jasmine-buffer
"*jasmine-node-specs-buffer*")
(defun jasmine-compile ()
"Run Jasmine-Node"
(interactive)
(shell-command (concat "jasmine-node " buffer-file-name) (get-buffer-create jasmine-buffer))
(display-buffer jasmine-buffer)
(with-current-buffer jasmine-buffer
(ansi-color-apply-on-region (point-min) (point-max))))
(defun cheater-apply-background-color ()
"format region with an ansi escape sequence background color."
(interactive)
(cheater-apply-ansi-escape-to-region (gethash
(concat (cheater-color-autocompleter "Background Color: ") "b")
cheater--ansi-code-hash)))
def kenzo
puts "DOOOOEEEEET"
end
(cabbage-vendor 'php-mode)
(defun tonini-php-run-single-file (filename)
(compile (format "%s %s %s"
"phpunit -c "
(format "%s%s" (cabbage-project-root) "build-config/")
filename)))
(defun tonini-php-mode-hook ()
(when (and buffer-file-name (string-match "Test.php$" buffer-file-name))
default:
paths:
features: src/AdminBundle/Features
bootstrap: %behat.paths.features%/Context
(defun phpunit-command ()
"Returns the phpunit command path (vendor/bin or bin/ because of composer)"
(cond ((file-readable-p (concat (cabbage-project-root) "vendor/bin/phpunit"))
(concat (cabbage-project-root) "vendor/bin/phpunit"))
((file-readable-p (concat (cabbage-project-root) "bin/phpunit"))
(concat (cabbage-project-root) "bin/phpunit"))
(t "phpunit")))
(defun phpunit-config-file ()
"Returns a given phpunit config file if exists (check app/ because of symfony default.)"