Skip to content

Instantly share code, notes, and snippets.

View chechedotmx's full-sized avatar
:shipit:
Codeando Ando

Sergio López chechedotmx

:shipit:
Codeando Ando
View GitHub Profile
let uri = "https://api.smartsheet.com/2.0/search/sheets/";
let sheetId = inputData.sheetId;
let productCode = inputData.productCode;
let options = {
method: 'GET',
headers: {'Authorization': 'Bearer '+inputData.token}
};
productCode = parseInt(productCode,10);
@chechedotmx
chechedotmx / zapier_csv_search.py
Created July 31, 2016 06:35
Zapier CSV Search
from googleapiclient.discovery import build
import pprint
import csv
my_api_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
my_cse_id = "xxxxxxxxxxxxxxx:xxxxxxxxxxxxx"
def google_search(search_term, api_key, cse_id, **kwargs):
service = build("customsearch", "v1", developerKey=api_key)
res = service.cse().list(q=search_term, cx=cse_id, **kwargs).execute()
return res['items']
@chechedotmx
chechedotmx / PalindromoMasGrande.cs
Created April 19, 2014 16:15
Palindromos de producto de 2
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AldeaDigital
{
class Program
{
@chechedotmx
chechedotmx / gist:7852449
Last active December 30, 2015 16:09
CMD Startup Task Azure to Install Crystal Reports and Fonts
@ECHO off
@REM Variables con las credenciales de Azure
set azurestoragename=xxxxxxxxxxxxxx
set azurestoragekey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==
set storagecontainername=xxxxx
@REM Azure Drive
@REM (A veces E:, A veces F:)
set drive=%cd:~0,3%
@chechedotmx
chechedotmx / gist:7852376
Created December 8, 2013 01:45
Service Definition with Startup task executionContext elevated
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="XentinelCloudInvoicingThreading" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-10.1.8">
<WorkerRole name="XentinelCloudInvoicingThreadingService" vmsize="ExtraSmall">
<Runtime executionContext="elevated" />
<Imports>
<Import moduleName="Diagnostics" />
<Import moduleName="RemoteAccess" />
<Import moduleName="RemoteForwarder" />
</Imports>
<Startup>
@chechedotmx
chechedotmx / GetSasFromURL_AMS.js
Last active December 23, 2015 21:19
This codes retreives an existing blob URL with sas with permissions to write an Azure Blob, but this time using javascript from Node.js, working on Azure Mobile Services
var azure = require('azure');
var blobService = azure.createBlobService('storageAccountName', 'storageAccountKey', 'host');
blobService.createContainerIfNotExists(containerName, {
publicAccessLevel : 'blob'
}, function(error) {
if (error) {
console.log("Error : " + error);
}
});
var mins = 10;
@chechedotmx
chechedotmx / GetBlobUriWithSAS.cs
Created September 13, 2013 03:06
This codes retreives an existing blob with permissions to read, Azure Blob, C# Then for example we get this data to a byte array
public String GetBlobUriWithSAS(String containerName, String blobName)
{
CloudBlobContainer container = this._blobClient.GetContainerReference(containerName);
container.CreateIfNotExists();
CloudBlockBlob blockBlob = container.GetBlockBlobReference(blobName);
String sharedAccesSignature = blockBlob.GetSharedAccessSignature(new SharedAccessBlobPolicy()
{
Permissions = SharedAccessBlobPermissions.Read,
SharedAccessExpiryTime = DateTime.UtcNow + TimeSpan.FromMinutes(10)
@chechedotmx
chechedotmx / gist:5696213
Last active December 18, 2015 00:19
Simple way to request blitline from azure mobile services or nodejs, without getting 411 errors, and string not matched
var foo = function() {
return {
sendHttpPostToBlitline : function(job_data, callBackBitline) {
var http = require('http');
var json_job_data = new Object();
json_job_data.json = job_data;
var job_data_stringified = JSON.stringify(json_job_data);
var options = {
host : 'api.blitline.com',
port : 80,