Skip to content

Instantly share code, notes, and snippets.

View fischerbach's full-sized avatar

Rafał fischerbach

View GitHub Profile
.
├── README.md
├── dashboard.py
├── locales
│ ├── base.pot
│ ├── de
│ │ └── LC_MESSAGES
│ │ └── base.po
│ └── pl
│ └── LC_MESSAGES
#include <stdio.h>
int main() {
float f = 1234.5678f;
union {
float f;
unsigned char b[4];
} my_f;
#include <stdio.h>
union Data {
int integer;
float real;
char character;
};
int main() {
union Data data;
#: dashboard.py:9
msgid "Enter API key"
msgstr ""
#: dashboard.py:35
msgid "## This app uses Zenserp API"
msgstr ""
import gettext
_ = gettext.gettext
###Each label string replace surround by _() function:
st.markdown(_('## This app uses Zenserp API'))
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
@fischerbach
fischerbach / Code.gs
Created December 19, 2020 10:02
Code for article
// 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 / surveyjs_with_ajax.js
Last active December 20, 2020 08:36
Code for article
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 / ajax_example.js
Created December 18, 2020 18:42
Code for article
$.ajax({
url: 'YOUR_APP_SCRIPT_URL',
type: 'post',
data: {
'question': 'answer'
}
});
@fischerbach
fischerbach / Code.gs
Created December 19, 2020 09:16
Code for article
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);
// }