Skip to content

Instantly share code, notes, and snippets.

@rwc9u
rwc9u / rwc-ruby.el
Created December 9, 2008 16:25
ruby flymake support
;;============================================================
;; flymake
;;============================================================
;; flymake ruby support
;; thanks to Dmitry Galinsky - this was taken from emacs-rails
(require 'flymake nil t)
(defconst flymake-allowed-ruby-file-name-masks
'(("\\.rb\\'" flymake-ruby-init)
("\\.rxml\\'" flymake-ruby-init)
#!/usr/bin/env ruby
# This is a quick script to generate YASnippets from TextMate Snippets.
#
# I based the script off of a python script of a similar nature by
# Jeff Wheeler: http://nokrev.com
# http://code.nokrev.com/?p=snippet-copier.git;a=blob_plain;f=snippet_copier.py
#
# Usage
#
# Make sure you have the plist and the choice gem installed
set the ClipURL to urlencode(the clipboard as string)
set curlCMD to ¬
"curl --stderr /dev/null \"http://api.shortswitch.com/shorten?apiKey=YOUR_API_KEY&url=" & ClipURL & "\""
do shell script curlCMD
set theResult to the result
javascript:(
function(){var s=document.createElement("script");
s.charset="UTF-8";
s.type="text/javascript";
s.src="http://shortswitch.com/admin/marklet/tweetie/APIKEY";
document.body.appendChild(s);})();
@rwc9u
rwc9u / sample.html
Created January 22, 2010 22:10
Example of how to use javascript and ajax calls to the ShortSwitch service to create a shortened URL on your own customized URL shortening service.
<style type="text/css" media="screen">
#shortswitch-it .box {
border:1px solid #999;
text-align:center;
margin:20px 60px;
padding: 10px;
}
.shortswitch-response-box {
background-color:#aaa;
margin:10px auto;
RewriteEngine on
RewriteRule ^/s/(.*)$ http://eyestreet.com.shortswitch.com/$1 [R,L]
<div id="tools">
<ul class="toolbar" id="left">
<li>Testing</li>
</ul>
<ul class="toolbar" id="right">
<li id="close_button"><a id="close" href="#">Close</a></li
</ul>
</div>
<div id="disclaimer">
<h1> Disclaimer</h1>
html {
background: none;
}
body {
margin: 0px;
background: none;
}
foo foo foo.This is a test
this is a test