This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'oauth' | |
# KEY and SECRET are available in Desk.com Admin -> Settings -> API -> | |
# My Applications -> Key and Secret fields | |
KEY = "YOUR_OAUTH_KEY" | |
SECRET = "YOUR_OAUTH_SECRET" | |
SITE = "https://yoursite.desk.com" | |
# start the process by requesting a token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fields = array( | |
'file_name' => "wallpaper.jpg", | |
'content-type' => "image/jpg", | |
'content' => '"'.base64_encode(file_get_contents("./wallpaper.jpg")).'"' | |
); | |
$fields_string = json_encode($fields); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
regex = /foo/; | |
//regex = /foo/g; | |
"foobarfoobar".replace(regex, function(str) { | |
if (RegExp.rightContext == "") { | |
return "ninja"; | |
} else { | |
return "pirate"; | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var target = target || "_blank"; | |
var re = new RegExp("\\b((?:[a-z][\\w-]+:(?:\/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\\s()<>]+|\(([^\\s()<>]+|(\([^\\s()<>]+\)))*\))+(?:\(([^\\s()<>]+|(\([^\\s()<>]+\)))*\)|[^\\s`!()\[\]{};:\'\".,<>?]))","g"); | |
text = "<a target=\"_blank\" href=\"http://www.google.com/\">http://www.google.com/</a>" + | |
" <a target=\"_blank\" href=\"http://www.desk.com/\">http://www.desk.com/</a>" | |
text = text.replace(re, function(str) { | |
var left = RegExp.leftContext; | |
// Chrome sometimes throws an exception when calling rightContext | |
// var right; try { right = RegExp.rightContext; } catch(e) { right = ""; }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% raw %} | |
<notextile> | |
{% if ‘something’ %} | |
Go to {{ help.where }} | |
{% endif %} | |
</notextile> | |
{% endraw %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#submission_view_modal { | |
background-image: url("../images/submission-view-modal.png"); | |
background-repeat: no-repeat; | |
position: absolute; | |
top: 74px; | |
left:11px; | |
z-index: 1001; | |
padding: 12px; | |
width: 475px; | |
height: 465px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~> Starting full deploy | |
~> Copying to /data/tabs_r192/releases/20110829191948 | |
~> Ensuring proper ownership | |
~> Gemfile detected, bundling gems | |
/usr/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:368:in `ensure_required_rubygems_version_met': ZenTest requires RubyGems version ~> 1.8. Try 'gem update --system' to update RubyGems itself. (Gem::InstallError) | |
from /usr/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:136:in `install' | |
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/source.rb:96:in `install' | |
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/installer.rb:55:in `block in run' | |
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `block in each' | |
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FoosController < ApplicationController | |
def zero | |
session[:zero] = "zero" | |
sleep 1 | |
render :text => "zero: #{session[:zero]}<br/>one: #{session[:one]}<br/>two: #{session[:two]} | |
<br/>three: #{session[:three]}" | |
end | |
def one | |
session[:one] = "one" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Failures: | |
1) Phase validation upload_sizing: upload width and height are set, but thumbs are not set: only image uploads are enabled: only has a resize key | |
Failure/Error: @phase.upload_sizing.should == @expected | |
expected: {:resize=>{:width=>800, :height=>800}, :export=>{:use=>["resize", "resize_thumb"]}} | |
got: {:resize=>{:width=>800, :height=>800}, :export=>{:use=>["resize"]}} (using ==) | |
Diff: | |
@@ -1,3 +1,2 @@ | |
-{:resize=>{:width=>800, :height=>800}, | |
- :export=>{:use=>["resize", "resize_thumb"]}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def upload_sizing | |
result = {:export => {use: []}} | |
return result unless self.uploads_enabled? | |
if self.upload_width? && self.upload_height? | |
if self.enable_images? | |
result[:resize] = { |