Skip to content

Instantly share code, notes, and snippets.

<?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);
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!");
}
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 {
# 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)
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}"
<%- @annual_update.comments.find(:all, :order => 'pages.number', :include => :page).each do |c| -%>
<%= c.page.label %>:
<%= c.comment %>
<%- end -%>
<%- 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 -%>
@twinge
twinge / CC Categories
Created November 22, 2009 14:42
Categories
[{"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" => []},
<?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>
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");