Skip to content

Instantly share code, notes, and snippets.

View zahhar's full-sized avatar
🏠
Working from home

Zahhar Kirillov zahhar

🏠
Working from home
  • Baltic IT Solutions OÜ
  • Switzerland
View GitHub Profile
@zahhar
zahhar / gs_igm.js
Last active July 17, 2018 20:22
Google Spreadsheet script for Instagram metrics
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Instagram')
.addItem('Update metrics', 'appendInstagramMetrics')
.addToUi();
}
function appendInstagramMetrics() {
var today = Utilities.formatDate(new Date(), "GMT+2", "dd.MM.yyyy HH:mm");
var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets().forEach(function (s) {
import sys
import json
import shutil
import unicodedata
import re
import os
from six.moves import urllib
target = "Downloads"
@zahhar
zahhar / func.patch
Last active November 13, 2018 19:48
--- func.php 2018-11-13 20:36:18.000000000 +0100
+++ func.php 2018-11-13 20:35:59.000000000 +0100
@@ -1096,7 +1096,8 @@
fn_pp_set_orders_lock($order_ids, true);
$mode = fn_pp_get_mode(reset($order_ids));
$url = ($mode == 'test') ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr';
- $result = Http::post($url, $data);
+ $extra['headers'] = ['User-Agent: php/'.phpversion()];
+ $result = Http::post($url, $data, $extra);
}
@zahhar
zahhar / scan.js
Last active August 29, 2021 11:51
Swisscom response examples
//npm init -y
//npm i node-fetch
//node scan.js
import fetch from 'node-fetch';
for(let i = 1000; i < 9999; i++) {
let response = await fetch('https://www.swisscom.ch/outages/guest/?origin=portal&lang=en&zip='+i);
let data = await response.json();
if (data.length > 0) console.log(data);