Skip to content

Instantly share code, notes, and snippets.



  • SanKontrol
  • Istanbul, TURKEY
View GitHub Profile
View How to link Sublime Text Build system to Python 3
sansal54 / Flask + Nginx konfigürasyonu
Last active May 11, 2020
Flask + Nginx konfigürasyonu
View Flask + Nginx konfigürasyonu
Assuming flask app is running on http://localhost:5000 with gunicorn and supervisor already setup.
# install nginx and dependencies
$ sudo apt-get install python3-dev nginx
create a new server block configuration file in Nginx’s sites-available directory named cafe_app13:
$ sudo nano /etc/nginx/sites-available/cafe_app13
Open up a server block and tell Nginx to listen on the default port 80. We also need to tell it to use this block for requests for our server’s domain name or IP address:
View gist:7bf565a30059b0f2053a3b3fa8bc1977
Get chat id from Telegram bot
1- Add the bot to the group.
Go to the group, click on group name, click on Add members, in the searchbox search for your bot like this: @my_bot, select your bot and click add.
2- Send a dummy message to the bot.
You can use this example: /my_id @my_bot
(I tried a few messages, not all the messages work. The example above works fine. Maybe the message should start with /)
sansal54 / quote.dart
Created Dec 9, 2019 — forked from mjohnsullivan/quote.dart
Simple Flutter app to retrieve and display a quote of the day
View quote.dart
import 'dart:async';
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
sansal54 /
Created Oct 8, 2019 — forked from boseji/
Raspberry Pi InfluxDB installation

Raspberry Pi InfluxDB: The solution for IoT Data storage

Raspberry Pi is costeffect linux computer very commonly used for IoT home automation projects.

Here are the 3 problems with conventional databases for IoT data store applications:

  • Too much or complex configuration
  • Unable to expire data / set retentional policies
  • Not tailor made of Time Series Data
sansal54 / spellnumber.vba
Created Sep 21, 2019
Convert Currency Numbers into Text #excel #vba #macro
View spellnumber.vba
Option Explicit
'Main Function
Function SpellNumber(ByVal MyNumber)
Dim Dollars, Cents, Temp
Dim DecimalPlace, Count
ReDim Place(9) As String
Place(2) = " Bin "
Place(3) = " Milyon "
Place(4) = " Milyar "
Place(5) = " Trilyon "
View send message to
import urllib.request
# Generate a bot ID here:
token = "822598813:AAHfVAjmDU3A6AgLpzbMEVImseo6a9HV5qo"
sansal_chat_id = "595115128"
kadir_chat_id = "936825399"
mymessage = "mesaj123"
url = ""
import PID
import time
import os.path
from OmegaExpansion import AdcExp
from OmegaExpansion import pwmExp
adc = AdcExp.AdcExp()
sansal54 /
Created Jan 21, 2017
InfluxDb Example with Modbus Room Thermostat in Python
import os
import sys
import time
import datetime
import minimalmodbus
from influxdb import InfluxDBClient
PORT_NAME = 'com7'