Skip to content

Instantly share code, notes, and snippets.

View rmehner's full-sized avatar
🤷‍♀️
¯\_(ツ)_/¯

Robin Mehner rmehner

🤷‍♀️
¯\_(ツ)_/¯
View GitHub Profile
tell application "Spotify"
return player position
end tell
-- returns 13.37
tell application "Spotify"
return "" & player position
end tell
store_template: &store_template
store:
robot: '/s3/store'
key: 'YOUR_AWS_KEY'
secret: 'YOUR_AWS_SECRET'
bucket: 'YOUR_S3_BUCKET'
production:
auth:
key: 'YOUR_KEY'
@rmehner
rmehner / ostruct_id_patch.rb
Created July 17, 2012 17:54
OpenStruct monkey patch to support id for RUBY_VERSION < 1.9
if RUBY_VERSION < '1.9'
# monkey patching open struct to allow overwriting id method
OpenStruct.__send__(:define_method, :id) { @table[:id] }
end
@rmehner
rmehner / implicit_begin_block.rb
Created June 25, 2012 10:10
implicit begin block
def throw_exception
raise "This is an exception"
rescue => e
puts e.message
end
throw_exception # output: "This is an exception"
@rmehner
rmehner / otsbjs.md
Created May 30, 2012 11:46 — forked from janl/otsbjs.md
Open Tech School Berlin JS

In the spirit of Railsgirls Berlin, we want to start a programming education group for JavaScript. We need your help to get all the coaching done.

If you are interested in coaching JavaScript, fork this gist and add yourself or leave your contact data in a comment:

<script type="text/javascript">
//<![CDATA[
window.foo || document.write('<script src="bla.js"></script>');
//]]>
</script>
%script
function ohai(msg) {
alert(msg);
}
sudo chown $(whoami):admin /usr/local && sudo chown -R $(whoami):admin /usr/local
@rmehner
rmehner / typo.patch
Created March 2, 2012 09:44
PubSub typo patch
diff --git a/js/vendor/pubsub.js b/js/vendor/pubsub.js
index ed8ecc4..7d90e2b 100644
--- a/js/vendor/pubsub.js
+++ b/js/vendor/pubsub.js
@@ -28,7 +28,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* In order to not have surprising behaviour where the execution chain generates more than one message,
* publication of messages with PubSub are done asyncronously (this also helps keep your code responsive, by
- * dividing work into smaller chunkcs, allowing the event loop to do it's business).
+ * dividing work into smaller chunks, allowing the event loop to do it's business).
diff --git a/js/vendor/pubsub.js b/js/vendor/pubsub.js
index ed8ecc4..b7b81cf 100644
--- a/js/vendor/pubsub.js
+++ b/js/vendor/pubsub.js
@@ -25,61 +25,61 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/** section: PubSub
* PubSubJS is a dependency free library for doing ['publish/subscribe'](http://en.wikipedia.org/wiki/Publish/subscribe)
* messaging in JavaScript.
- *
- * In order to not have surprising behaviour where the execution chain generates more than one message,