Skip to content

Instantly share code, notes, and snippets.

Avatar

Rafał fischerbach

View GitHub Profile
View base.pot
#: dashboard.py:9
msgid "Enter API key"
msgstr ""
#: dashboard.py:35
msgid "## This app uses Zenserp API"
msgstr ""
View dashboard_gettext.py
import gettext
_ = gettext.gettext
###Each label string replace surround by _() function:
st.markdown(_('## This app uses Zenserp API'))
View structure
.
├── README.md
├── dashboard.py
├── locales
│ ├── base.pot
│ ├── de
│ │ └── LC_MESSAGES
│ │ └── base.po
│ └── pl
│ └── LC_MESSAGES
View facebook_leak_file_sizes.tsv
country file size (MB)
Egypt 1638.4
Saudi Arabia 1126.4
Italy 1024
USA 949.3
Morocco 698.4
Iraq 697.9
Turkey 641.2
France 610.5
Colombia 495.9
View survey.html
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link href="https://unpkg.com/survey-jquery@1.8.21/modern.css" type="text/css" rel="stylesheet" />
View surveyjs_with_ajax.js
Survey.StylesManager.applyTheme("modern");
var surveyJSON = {"pages":[{"name":"page1","elements":[{"type":"rating","name":"rate","title":"On a scale of one to five, how likely are you to recommend my article to a friend or colleague? *","minRateDescription":"(Most unlikely)","maxRateDescription":"(Most likely)"}]}]};
function sendDataToServer(survey, options) {
//Display information about sending data
options.showDataSaving();
$.ajax({
url: 'https://script.google.com/macros/s/AKfycby_XZaWjAb7DMbtXdOsEsPiwS3lM4NkLPhi5f3D1fdhCatn5sOQ0r2v/exec',
type: 'post',
@fischerbach
fischerbach / Code.gs
Created Dec 19, 2020
Code for article
View Code.gs
// Enter sheet name where results will be collected
var SHEET_NAME = "Sheet1";
var CHOICES_SHEET_NAME = "Choices"; //We will use it later
var SCRIPT_PROP = PropertiesService.getScriptProperties(); // new property service
//Fetching choice options from spreadsheet
function doGet(e){
return getDataFromSheet();
}
@fischerbach
fischerbach / Code.gs
Created Dec 19, 2020
Code for article
View Code.gs
var SHEET_NAME = "Sheet1"; // Enter sheet name where results will be collected
var CHOICES_SHEET_NAME = "Choices"; //We will use it later
var SCRIPT_PROP = PropertiesService.getScriptProperties(); // new property service
//We will utilise GET method later
// function doGet(e){
// return handleResponse(e);
// }
View choices.json
[
{
"domain":"facebook.com",
"name":"Facebook"
},
{
"domain":"twitter.com",
"name":"Twitter"
},
{
View ajax_example.js
$.ajax({
url: 'YOUR_APP_SCRIPT_URL',
type: 'post',
data: {
'question': 'answer'
}
});