Skip to content

Instantly share code, notes, and snippets.

View sansal54's full-sized avatar

sansal54

  • SanKontrol
  • Istanbul, TURKEY
View GitHub Profile
@sansal54
sansal54 / gradient.dart
Created March 6, 2024 11:39 — forked from tusharhow/gradient.dart
Did you know that in Flutter, bringing gradient colors to your text is a breeze? 🚀💻 Just sprinkle a bit of code magic:
Text(
"Gradient Text Example",
style: TextStyle(
fontSize: 50.0,
fontWeight: FontWeight.bold,
foreground: Paint()
..shader = const LinearGradient(
colors: <Color>[
Colors.red,
Colors.blue,
@sansal54
sansal54 / install_pyenv.sh
Last active April 12, 2022 09:38 — forked from jmvrbanac/install_pyenv.sh
Install pyenv on Ubuntu
sudo apt-get install git python3-pip make build-essential libssl-dev libffi-dev python-is-python3 zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl
sudo pip3 install virtualenvwrapper
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper
git clone https://github.com/pyenv/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
@sansal54
sansal54 / create_new_user.md
Created August 10, 2021 21:36 — forked from JeremyIglehart/create_new_user.md
How to create a new user and remove the `pi` user on a Raspberry Pi

How to create a new user and remove the pi user on a Raspberry Pi

Note: This has been tested in Rasbian Buster released on 2019-06-20

Important: replace jeremy below with whatever username you'd like as your new user.

  1. sudo adduser jeremy
    • You will be asked to enter a password
    • When filling out basic information about the user, you may leave it blank
@sansal54
sansal54 / Flask + Nginx konfigürasyonu
Last active May 11, 2020 09:46
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:
@sansal54
sansal54 / gist:7bf565a30059b0f2053a3b3fa8bc1977
Created March 15, 2020 21:03
Get chat id from Telegram bot
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
sansal54 / quote.dart
Created December 9, 2019 20:27 — forked from mjohnsullivan/quote.dart
Simple Flutter app to retrieve and display a quote of the day
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 {
@override
@sansal54
sansal54 / Rpi-InfluxDB-Install.md
Created October 8, 2019 17:19 — forked from boseji/Rpi-InfluxDB-Install.md
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
sansal54 / spellnumber.vba
Created September 21, 2019 18:20
Convert Currency Numbers into Text #excel #vba #macro
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 "
@sansal54
sansal54 / send message to telegram.py
Created September 11, 2019 08:46
Send message to Telegram
import urllib.request
# Generate a bot ID here: https://core.telegram.org/bots#botfather
token = "822598813:AAHfVAjmDU3A6AgLpzbMEVImseo6a9HV5qo"
sansal_chat_id = "595115128"
kadir_chat_id = "936825399"
mymessage = "mesaj123"
url = "https://api.telegram.org/bot822598813:AAHfVAjmDU3A6AgLpzbMEVImseo6a9HV5qo/sendMessage?chat_id=595115128&text=Sansal"