This file contains hidden or 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 | |
$file = "/var/www/vhosts/cltv8.com/httpdocs/integrawebdemo/video/IntegraWeb_Tour.wmv"; | |
if (!file_exists($file)) trigger_error("File '$file' doesn't exist.", E_USER_ERROR); | |
header("Content-type: application/octet-stream"); | |
header('Content-Disposition: attachment; filename="' . basename($file) . '"'); | |
header("Content-Length: ". filesize($file)); | |
readfile($file); |
This file contains hidden or 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
function loadPrintable(e:Event) | |
{ | |
trace(detail.mcProducts.supplierId.text); | |
var url:String = xmlContent.appSettings.setting.(@name == "printableStockingList") + "?id=" + detail.mcProducts.supplierId.text ; | |
var request:URLRequest = new URLRequest(url); | |
try { | |
navigateToURL(request, '_blank'); // second argument is target | |
} catch (e:Error) { | |
trace("Error occurred!"); | |
} |
This file contains hidden or 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
private function showDetail(e:Event) { | |
var res:XMLList | |
if (e.target.toString().indexOf("List") >= 0) { | |
var lbl:String; | |
var xpath:String; | |
var q:XPathQuery = new XPathQuery(xpath); | |
lbl = mcResults.lstResults.itemToLabel(e.target.selectedItem); | |
xpath = "//supplier[name = '" + lbl + "']"; | |
res = q.exec(xmlContent)[0]; | |
} else { |
This file contains hidden or 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
# above your test | |
require 'mocha' | |
# in your test | |
response = mock | |
response.stubs(:success?).returns(true) | |
response.stubs(:authorization).returns(true) | |
response.stubs(:params).returns({}) | |
ActiveMerchant::Billing::AuthorizeNetGateway.any_instance.stubs(:purchase).returns(response) |
This file contains hidden or 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
apps = {'gmx' => {:workers => 1, :env => 'production'}, | |
'jtrk' => {:workers => 1, :env => 'development'}, | |
'files.colortone' => {:workers => 1, :env => 'development'}, | |
'culture' => {:workers => 1, :env => 'production'}, | |
'uploadjobfiles' => {:workers => 1, :env => 'development'}} | |
apps.each do |app, params| | |
rails_root = "/var/www/#{app}/current" | |
params[:workers].times do |num| | |
God.watch do |w| | |
w.name = "dj-#{app}-#{num}" |
This file contains hidden or 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
<%- @annual_update.comments.find(:all, :order => 'pages.number', :include => :page).each do |c| -%> | |
<%= c.page.label %>: | |
<%= c.comment %> | |
<%- end -%> |
This file contains hidden or 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
<%- Page.find(:all, :order => 'number').each do |page| | |
comment = Comment.find_by_page_id_and_annual_update_id(page.id, @annual_update.id) -%> | |
Page Name: <%= page.label %> | |
<%= comment.comment %> | |
<%- end -%> |
This file contains hidden or 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
[{"Aircraft" => [ | |
{"Civilian" => ["Commercial", "Helicopter", "Jet", "Private", "Propellers", "Sport", "Baloon", "Blimp"]}, | |
{"Historic" => []}, | |
{"Military" => ["Bomber", "Fighter", "Helicopter", "Recon", "Transport"]}, | |
{"Parts" => ["Bomb", "Engine", "Parachute", "Propeller", "Weapons", "Wings"]} | |
]}, | |
{"Anatomy" => [ | |
{"Body" => []}, | |
{"Extremity" => []}, | |
{"Head" => []}, |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<product> | |
<information> | |
<name>test</name> | |
<mature>false</mature> | |
<media_type>3D Models</media_type> | |
<keywords>sdg </keywords> | |
<price_modality>Fixed</price_modality> | |
<price_dollars>0.00</price_dollars> | |
<price_euros>0.00</price_euros> |
This file contains hidden or 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
public static void postThumbnail() throws IOException, MalformedURLException { | |
final WebClient webClient = new WebClient(); | |
webClient.addRequestHeader("ACCEPT", "text/xml"); | |
final String userhash = Base64Coder.encodeString("username:password"); | |
webClient.addRequestHeader("Authorization", "Basic " + userhash); | |
final HtmlPage page1 = (HtmlPage)webClient.getPage("http://www.creativecrash.com/assets/cg_thumbnail"); |