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
# Easy download examples | |
# | |
# First example, downloads 10 files from the same server sequencially using the same | |
# easy handle with a persistent connection | |
# | |
# Second example, sends all 10 requests in parallel using 10 easy handles | |
# | |
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..', 'ext'))) | |
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))) | |
require 'curb' |
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
#!/usr/bin/env bash | |
# | |
# url : https://gist.github.com/672684 | |
# version : 2.0.2 | |
# name : appify | |
# description : Create the simplest possible mac app from a shell script. | |
# usage : cat my-script.sh | appify MyApp | |
# platform : Mac OS X | |
# author : Thomas Aylott <oblivious@subtlegradient.com> |
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
# Copyright Camptocamp SA 2012 | |
# License: AGPL (GNU Affero General Public License)[http://www.gnu.org/licenses/agpl-3.0.txt] | |
# Author Guewen Baconnier | |
require "xmlrpc/client" | |
require 'pp' | |
XMLRPC::Config::ENABLE_NIL_PARSER = true | |
XMLRPC::Config::ENABLE_NIL_CREATE = true | |
class MagentoAPI |
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 LocalResource | |
attr_reader :uri | |
def initialize(uri) | |
@uri = uri | |
end | |
def file | |
@file ||= Tempfile.new(tmp_filename, tmp_folder, encoding: encoding).tap do |f| | |
io.rewind |