Skip to content

Instantly share code, notes, and snippets.

View pxlpnk's full-sized avatar
💭
👋 hey

Andreas Tiefenthaler pxlpnk

💭
👋 hey
View GitHub Profile
@pxlpnk
pxlpnk / revert-all-buffers.el
Created January 24, 2012 14:18
function to revert all open buffers in emacs
(defun revert-all-buffers ()
"Refreshes all open buffers from their respective files"
(interactive)
(let* ((list (buffer-list))
(buffer (car list)))
(while buffer
(when (buffer-file-name buffer)
(set-buffer buffer)
(revert-buffer t t t))
(setq list (cdr list))
@pxlpnk
pxlpnk / irb_test
Last active December 15, 2015 11:59
it works!!
→ curl -o vienna.rb https://gist.github.com/pxlpnk/5257111/raw/a577da6be4807daa4b4a2751659d100f7d1ba9f6/vienna.rb
→ irb -r "./vienna.rb"
>> v = Vienna.new
=> The next vienna.rb takes place at sektor5 Siebenbrunnengasse 44, 1050 Wien and starts at 2013-04-12 18:00:00 +0100. For more see: http://vienna-rb.at/blog/2013/03/19/second-meetup-to-take-place-at-co-working-space-sektor5/
>> v.where?
=> #<struct Struct::Location name="sektor5", address="Siebenbrunnengasse 44, 1050 Wien", details=nil>
@pxlpnk
pxlpnk / cosmetics.el
Created May 19, 2013 13:51
set comment fontsize to 0.8
(custom-set-faces
'(font-lock-comment-face ((t (:height 0.8)))))
ruby -rwebrick -e"s = WEBrick::HTTPServer.new(:Port => 3000, :DocumentRoot => Dir.pwd); trap('INT') { s.shutdown }; s.start"
@pxlpnk
pxlpnk / gist:7007745
Last active December 25, 2015 16:39
__FILE__ == $0 with symlinks?
~❯ ls -lah
total 8.0K
drwxr-xr-x 4 at 136 Oct 16 15:26 .
drwxr-xr-x 16 at 544 Oct 16 15:22 ..
-rw-r--r-- 1 at 86 Oct 16 15:26 luke.rb
lrwxr-xr-x 1 at 7 Oct 16 15:26 yoda.rb -> luke.rb
~❯ cat luke.rb
p [__FILE__, $0]
if __FILE__ == $0
puts '__FILE__ == $0'
@pxlpnk
pxlpnk / gist:7023731
Created October 17, 2013 12:06
list AAAAAAALLLL the gems!
abstract_type (0.0.6)
actionmailer (4.0.0, 3.2.13)
actionpack (4.0.0, 3.2.13)
activemodel (4.0.0, 3.2.13)
activerecord (4.0.0, 3.2.13)
activerecord-deprecated_finders (1.0.3)
activerecord-import (0.3.1)
activerecord-postgresql-adapter (0.0.1)
activeresource (3.2.13)
activesupport (4.0.0, 3.2.13)
@pxlpnk
pxlpnk / vienna-rb_talk.md
Last active December 25, 2015 23:09
Lightning talk at the DevFest 2013.

Introducing vienna.rb

What is vienna.rb

User group meetly meetups with talks, drinks and social interaction. We have a diverse selection of topics and people

{
:key1 => {
:key3 => {
:not_always_there => 'yay'
},
},
:key2 => {
:key3 => "yolo"
}
}
@pxlpnk
pxlpnk / have_xml.rb
Last active December 26, 2015 22:29
rexml xpath matcher for rspec
# cheap mans xpath matcher
# inspired by: https://gist.github.com/faun/4279964
RSpec::Matchers.define :have_xml do |xpath, text|
match do |body|
doc = REXML::Document.new(body)
nodes = REXML::XPath.match(doc, xpath)
if text
nodes.each do |node|
node.content.should == text
end