Skip to content

Instantly share code, notes, and snippets.

View jtubert's full-sized avatar

Juan (John) Tubert jtubert

View GitHub Profile
{
"_acl" : {
"editors" : {
"groups" : [ ],
"users" : [ ]
},
"readers" : {
"departments" : [ ],
"offices" : [ ],
"organizations" : [ ],
FROM tensorflow/tensorflow:1.12.0-py3
ENV LANG=C.UTF-8
RUN mkdir /gpt-2
WORKDIR /gpt-2
COPY requirements.txt /gpt-2/
RUN apt-get update && \
apt-get install -y curl
RUN pip3 install -r requirements.txt
steps:
# build the container image
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/my-project/my-build', '.']
# push the container image to Container Registry
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/my-project/my-build']
# Deploy container image to Cloud Run
- name: 'gcr.io/cloud-builders/gcloud'
args: ['beta', 'run', 'deploy', 'my-build', '--allow-unauthenticated', '--image', 'gcr.io/my-project/my-build', '--region', 'us-central1', '--memory', '2G', '--timeout=15m']
@jtubert
jtubert / shortcut_upload_s3.js
Created January 27, 2019 03:22
Upload photo to S3 from ios shortcut
const util = require('util');
const AWS = require('aws-sdk');
module.exports = function (context, cb) {
if(context.body && context.body.base64Image){
uploadFromShortcut(context, cb);
return;
}
};
@jtubert
jtubert / categories.json
Created April 19, 2017 02:05
categories
{
"meta-data" : {
"code" : 200,
"message" : "OK",
"totalResults" : 466,
"offset" : 0,
"limit" : 50,
"prev" : "",
"next" : "http://api.pingup.com/v1/categories?offset=50&limit=50"
},
@jtubert
jtubert / popup.js
Created January 19, 2016 04:14
Chrome extension for saving top visited sites in Google spreadsheet
var settings;
var email;
var id;
loadSavedSettings();
function loadSavedSettings() {
// buttonSettings
if (!window.localStorage.buttonSettings) {
@jtubert
jtubert / spreadsheet_script_topvisited.js
Last active January 19, 2016 04:10
Save top visited sites in Google spreadsheets
//  1. Enter sheet name where data is to be written below
        var SHEET_NAME = "Other";
         
//  2. Run > setup
//
//  3. Publish > Deploy as web app
//    - enter Project Version name and click 'Save New Version'
//    - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously)
//
//  4. Copy the 'Current web app URL' and post this in your form/script action
@jtubert
jtubert / highfive.js
Created November 17, 2015 02:24 — forked from kmoe/highfive.js
module['exports'] = function highFive(hook) {
// hook.io has a range of node modules available - see
// https://hook.io/modules.
// We use request (https://www.npmjs.com/package/request) for an easy way to
// make the HTTP request.
var request = require('request');
// The parameters passed in via the slash command POST request.
var params = hook.params;
@jtubert
jtubert / gist:6759029
Created September 30, 2013 03:26
Sketchio presentation - login
Parse.initialize(KEY, SECRET);
window.fbAsyncInit = function() {
// init the FB JS SDK
Parse.FacebookUtils.init({
appId : '1386686244890246', // App ID from the app dashboard
channelUrl : 'channel.html', // Channel file for x-domain comms
status : false, // check login status
cookie : true, // enable cookies to allow Parse to access the session
@jtubert
jtubert / gist:6747749
Created September 28, 2013 23:25
Sketchio presentation - Javascript get sketches
Parse.initialize(KEY, SECRET);
var Photo = Parse.Object.extend("Photo");
var query = new Parse.Query(Photo);
query.equalTo("user", Parse.User.current());
query.descending("createdAt");
query.find({
success: function(photosArr) {
//show images