Son güncelleme / Last updated: 2026-05-10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # exit on error | |
| set -e | |
| CONF_DIR=~/.kube/config.d | |
| require() { | |
| if ! hash "$1" &>/dev/null; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # alias kctx="source ~/.bin/kctx.sh" | |
| CONF_DIR=~/.kube/config.d | |
| file=$(ls -1 $CONF_DIR | fzf) | |
| echo "$file" | |
| if [[ ! "$file" == "null" ]]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // formatter adds default fields to each log entry. https://github.com/sirupsen/logrus/pull/653#issuecomment-454467900 | |
| type formatter struct { | |
| Fields logrus.Fields | |
| Lf logrus.Formatter | |
| } | |
| // Format satisfies the logrus.Formatter interface. | |
| func (f *formatter) Format(e *logrus.Entry) ([]byte, error) { | |
| for k, v := range f.Fields { | |
| e.Data[k] = v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use actix_service::{Service, Transform}; | |
| use actix_web::{dev::ServiceRequest, dev::ServiceResponse, Error}; | |
| use futures::future::{ok, Ready}; | |
| use futures::{Future}; | |
| use slog::info; | |
| use futures::task::Poll; | |
| use std::task::Context; | |
| use std::pin::Pin; | |
You have to do 2 things in order to allow your container to access your host's postgresql database
- Make your postgresql listen to an external ip address
- Let this client ip (your docker container) access your postgresql database with a given user
Obs: By "Host" here I mean "the server where docker is running on".
Find your postgresql.conf (in case you don't know where it is)
$ sudo find / -type f -name postgresql.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| void main() async { | |
| runApp(new TestApp()); | |
| } | |
| class TestApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright 2017, the Flutter project authors. Please see the AUTHORS file | |
| // for details. All rights reserved. Use of this source code is governed by a | |
| // BSD-style license that can be found in the LICENSE file. | |
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(new TestApp()); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String formatMoney(dynamic text) { | |
| if (text is num){ | |
| text = text.toStringAsFixed(2); | |
| } | |
| return text | |
| .toString() | |
| .replaceAllMapped(RegExp(r"(\d)(?=(\d{3})+\.)"), (m) => "${m.group(1)}.") | |
| .replaceAllMapped(RegExp(r"\.(\d+)$"), (m) => ",${m.group(1)}"); | |
| } |
NewerOlder