Skip to content

Instantly share code, notes, and snippets.

View chiefkana's full-sized avatar
🏢
Working

Kanat Bektursyn chiefkana

🏢
Working
  • ATI.kz
  • Kazakhstan, Almaty
View GitHub Profile
@chiefkana
chiefkana / gist:37f8d14e195adf83c585e9ce4a76a786
Created March 21, 2022 10:13 — forked from sc212/gist:2287047
CSS: Clean up default browser styling
html, body {
border:0;
margin:0;
padding:0;
}
body {
font:100%/1.25 Arial, Helvetica, sans-serif;
}

SocketException: OS Error: Connection refused, errno = 111 in flutter

In case you got the same error

Flutter uses local machines IPv4 address, so if you run into the same error try:

  • Try to change url string from Uri.parse('http://localhost:5000/') to Uri.parse('http://127.0.0.1:5000/')
  • If that didn't work try to go for you local IPv4 address. "But I can't always go and check local ip and hardcode it into my app", you might say. Well, flutter has the workaround for trouble. Use 10.0.2.2 instead of localhost and flutter will dynamically use machines IPv4 in emulator and simulator.
@chiefkana
chiefkana / node_nginx_ssl.md
Created September 16, 2021 11:00 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@chiefkana
chiefkana / associations.js
Created September 10, 2021 05:49
Sequelize multiple model associations to unaltered (same) model or table
/*
Defining the User Model
-------------
User
-------------
id: PK
username: str
*/
const User = sequelize.define("user", {
id: {

Configure Mail Settings

Before you can send emails with ColdFusion, a mail server you want to use needs to be set. Configuring the mail server can be done in the ColdFusion Administrator.

If you do not have a mail server of your own, your localhost can act as a mail server. ColdFusion will act normally, but since there is no mail server set up on your localhost, emails will not arrive at their destination. Another option is to use the mail server of Gmail (a Gmail account is required for this). The settings for this mail server can be found at the end of this section.

@chiefkana
chiefkana / autoStore.js
Created September 2, 2021 06:52 — forked from du5rte/autoStore.js
Auto saving to localStorage with MobX
import mobx from "mobx"
import store from "store"
export default function(_this) {
let firstRun = true
// will run on change
mobx.autorun(() => {
// on load check if there's an existing store on localStorage and extend the store
if (firstRun) {