Skip to content

Instantly share code, notes, and snippets.

@nonotest
nonotest / main.go
Last active June 11, 2017 09:16
Copy a file uploaded with react native background uploader to google cloud
// UploadAttachmentsEndpoint uses httprouter package..
func UploadAttachmentsEndpoint(res http.ResponseWriter, req *http.Request, _ httprouter.Params) {
// init your client
//...
// init your bucket
storageBucket := client.Bucket(storageBucketName)
w := storageBucket.Object(name).NewWriter(ctx)
w.ContentType = req.Header.Get("Content-Type")
@nonotest
nonotest / getpost.csx
Created October 5, 2017 06:57
headers for admin (x total count)
using System.Net;
using Dapper;
using System.Data.SqlClient;
using System.Configuration;
using System.Net.Http.Headers;
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
log.Info($"C# HTTP trigger function processed a request. RequestUri={req.RequestUri}");
@nonotest
nonotest / rest.csx
Created October 5, 2017 06:59
other calls
using System.Net;
using Dapper;
using System.Data.SqlClient;
using System.Configuration;
using System.Net.Http.Headers;
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
log.Info($"C# HTTP trigger function processed a request. RequestUri={req.RequestUri}");
@nonotest
nonotest / wrap.js
Created October 29, 2018 10:14
Trying to get flex wrap to work with multiple elements, including a <Text> that may have multiple lines.
<View
style={{
flexDirection: 'row',
flexWrap: 'wrap',
alignItems: 'flex-start',
flex: 1,
}}
>
[<Text/>,<Tag />...]
</View>