Skip to content

Instantly share code, notes, and snippets.

View z347's full-sized avatar
🙃
programming is fun

Volodymyr Shylo z347

🙃
programming is fun
  • Ukraine, Lviv
View GitHub Profile
@kuhelbeher
kuhelbeher / readme.md
Last active December 6, 2022 16:20
Eslint airbnb config + prettier for create-react-app project

This is tutorial of onfiguring eslint, prettier for your project

Make your code great again

  1. Eslint

First of all we need to install eslint and configs as dev dependencies. You can use your own config, but I will use config from airbnb:

yarn add -D eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react
@jesperorb
jesperorb / php_form_submit.md
Last active April 30, 2024 22:27
PHP form submitting with fetch + async/await

PHP Form submitting

If we have the following structure in our application:

  • 📁 application_folder_name
    • 📄 index.php
    • 📄 handle_form.php
    • 📄 main.js

And we fill our index.php with the following content just to get a basic website with a form working. You should be able to run this through a php-server of your choice.

@neretin-trike
neretin-trike / metatag.md
Last active September 23, 2023 04:06
SEO оптимизация сайта

Основные мета-теги

Мета-теги - это служебные слова, которые содержат важную информацию о веб-документе для поисковых систем. В большинстве случаев размещаются внутри тега head.
Список мета-тегов для атрибута name:

  • description — описание веб-страницы, должно быть достаточно длинным и полным
  • keywords — ключевые слова,
  • generator — CMS сайта,
  • author — автор,
  • copyright — авторские права,
  • robots — правила индексирования страницы для роботов,
  • viewport — данные о настройке области просмотра
@eastenluis
eastenluis / map-item.js
Created December 6, 2017 15:18
Mongoose GeoJSON schema example
const mapItemSchema = new mongoose.Schema({
name: String,
location: {
// It's important to define type within type field, because
// mongoose use "type" to identify field's object type.
type: {type: String, default: 'Point'},
// Default value is needed. Mongoose pass an empty array to
// array type by default, but it will fail MongoDB's pre-save
// validation.
coordinates: {type: [Number], default: [0, 0]}
@ywwwtseng
ywwwtseng / host-react-app-on-apache-server.md
Last active May 3, 2024 15:52
Host react application on Apache server

Host react application on Apache server

Step 1 : Create your app

$ npm install -g create-react-app 
$ create-react-app my-app

Step 2 : Build it for production

@kumarharsh
kumarharsh / Mongo ObjectID to Timestamp
Created May 19, 2013 15:40
A snippet to convert Mongo ObjectID to javascript timestamps, and vice-versa
----- mongo to js ------
timeStamp = parseInt(Mongo.ObjectId().toString().substr(0,8), 16)*1000
date = new Date(timestamp)
-----------------------------
----- js to mongo -----
timestamp = new Date().getTime()/1000
mongoId = new ObjectID(timestamp.toString(16)+1e16)
@yourdesigncoza
yourdesigncoza / php-mail-postfix-ubuntu
Created April 26, 2013 18:42
Ubuntu PHP mail() Function with Postfix
# Ubuntu PHP mail
# Ubuntu 12.04 LTS
# IMPORTANT : add your own data or parameters, I make use of double segments [[ your variable ]]. eg. ssh root@[[ 96.172.44.11 ]] should be replaced with ssh root@888.88.88.88 where "888.88.88.88" is your value, variable etc. I have a habit of using ":::" to indicate line ending and end of paragraph, crazy I know but be warned its just how I write ::: All notes are for my own use & should you use any it's at your own risk, it's NOT a Tutorial :::
# Resources
# https://help.ubuntu.com/12.04/serverguide/postfix.html
# http://sourcelibrary.org/2011/08/29/how-to-set-up-the-php-mail-function-on-a-ubuntu-linux-lamp-server/
# http://stackoverflow.com/questions/12083025/xampp-on-ubuntu-server-12-04-with-pear-installed-returns-errors-when-trying-to-u
# http://askubuntu.com/questions/47609/how-to-have-my-php-send-mail