Skip to content

Instantly share code, notes, and snippets.

View muravjov's full-sized avatar

Ilya Murav'jov muravjov

  • Saint-Petersburg
View GitHub Profile
# Copyright 2019 Google LLC.
# SPDX-License-Identifier: Apache-2.0
# This snippet shows you how to use Blob.generate_signed_url() from within compute engine / cloud functions
# as described here: https://cloud.google.com/functions/docs/writing/http#uploading_files_via_cloud_storage
# (without needing access to a private key)
# Note: as described in that page, you need to run your function with a service account
# with the permission roles/iam.serviceAccountTokenCreator
import os, google.auth
from google.auth.transport import requests
@buzztaiki
buzztaiki / gjs-io-sample.js
Created December 16, 2011 20:18
gjs-io-sample.js
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
let [res, out, err, status] = GLib.spawn_command_line_sync('ls -la');
print(out);
let [res, out] = GLib.spawn_command_line_sync('ls -la');
print(out);
let [res, out] = GLib.spawn_sync(null, ['/bin/ls', '-la'], null, 0, null);