Skip to content

Instantly share code, notes, and snippets.

@BennyFranco
BennyFranco / get_sfml.rs
Created April 26, 2019 00:34
Get and save binary file with Rust and libcurl
use curl::easy::Easy;
use std::fs::File;
use std::io::prelude::*;
fn main() -> std::io::Result<()> {
let mut dst = Vec::new();
let mut easy = Easy::new();
easy.url("https://github.com/SFML/SFML/releases/download/2.5.1/SFML-2.5.1-windows-vc15-64-bit.zip").unwrap();
let _redirect = easy.follow_location(true);
# Set proxy settings if behind an enterprise proxy by using these in PS profile
[system.net.webrequest]::defaultwebproxy = new-object system.net.webproxy('http://proxy:port')
[system.net.webrequest]::defaultwebproxy.credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
[system.net.webrequest]::defaultwebproxy.BypassProxyOnLocal = $true
# Set proxy settings for git
git config --global https.proxy http://username:password@proxy:port
git config --global http.sslVerify false
# Type the command to install Chocolatey
using System;
using System.Diagnostics;
using System.Windows.Forms;
namespace ConsoleExRun
{
class Program
{
[STAThread]
static void Main(string[] args)