Skip to content

Instantly share code, notes, and snippets.

View fischerbach's full-sized avatar

Rafał fischerbach

View GitHub Profile
#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'))
.
├── README.md
├── dashboard.py
├── locales
│ ├── base.pot
│ ├── de
│ │ └── LC_MESSAGES
│ │ └── base.po
│ └── pl
│ └── LC_MESSAGES
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 / survey.html
Created December 19, 2020 22:22
Code for article
<!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" />
@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 / 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 / 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);
// }