Skip to content

Instantly share code, notes, and snippets.

View hero9's full-sized avatar
:shipit:
Focusing

Galymzhan Almabek hero9

:shipit:
Focusing
  • Openmatics
  • Prague
  • 02:11 (UTC +02:00)
View GitHub Profile
@hero9
hero9 / js-task-1.md
Created March 19, 2018 07:37 — forked from codedokode/js-task-1.md
Задания на яваскрипт (простые)
@hero9
hero9 / server.js
Created March 23, 2018 10:28
Basic Express settings.
var express = require('express');
var path = require('path'); // модуль для парсинга пути
var app = express();
app.use(express.favicon()); // отдаем стандартную фавиконку, можем здесь же свою задать
app.use(express.logger('dev')); // выводим все запросы со статусами в консоль
app.use(express.bodyParser()); // стандартный модуль, для парсинга JSON в запросах
app.use(express.methodOverride()); // поддержка put и delete
app.use(app.router); // модуль для простого задания обработчиков путей
app.use(express.static(path.join(__dirname, "public"))); // запуск статического файлового сервера, который смотрит на папку public/ (в нашем случае отдает index.html)
@hero9
hero9 / new_gist_file_0
Created March 25, 2018 13:57
mongoDB start
sudo service mongod start
@hero9
hero9 / Gulpfile.js
Created April 3, 2018 15:18 — forked from webdesserts/Gulpfile.js
Automatically reload your node.js app on file change with Gulp (https://github.com/wearefractal/gulp).
// NOTE: I previously suggested doing this through Grunt, but had plenty of problems with
// my set up. Grunt did some weird things with scope, and I ended up using nodemon. This
// setup is now using Gulp. It works exactly how I expect it to and is WAY more concise.
var gulp = require('gulp'),
spawn = require('child_process').spawn,
node;
/**
* $ gulp server
* description: launch the server. If there's a server already running, kill it.
@hero9
hero9 / gulp_tasks
Created April 8, 2018 09:09
Gulp tasks
var gulp = require('gulp'), // Подключаем Gulp
sass = require('gulp-sass'), //Подключаем Sass пакет,
browserSync = require('browser-sync'), // Подключаем Browser Sync
concat = require('gulp-concat'), // Подключаем gulp-concat (для конкатенации файлов)
uglify = require('gulp-uglifyjs'), // Подключаем gulp-uglifyjs (для сжатия JS)
cssnano = require('gulp-cssnano'), // Подключаем пакет для минификации CSS
rename = require('gulp-rename'), // Подключаем библиотеку для переименования файлов
del = require('del'), // Подключаем библиотеку для удаления файлов и папок
imagemin = require('gulp-imagemin'), // Подключаем библиотеку для работы с изображениями
pngquant = require('imagemin-pngquant'), // Подключаем библиотеку для работы с png
#!/bin/bash
sudo apt update &&
sudo apt upgrade -y &&
#---GDEBI---
sudo apt install -y gdebi &&
#---SOFTWARE-PROPERTIES-COMMON for adding third-party repos
sudo apt install -y software-properties-common &&
#---Elementary Tweaks---
sudo add-apt-repository -y ppa:philip.scott/elementary-tweaks &&
sudo apt update &&
@hero9
hero9 / gist:82f9f8398fc8fe3531b93bf4060a501f
Created July 20, 2018 10:45 — forked from molivier/gist:271bba5d67de1583a8e3
Set $GOPATH on Mac OSX : bash_profile
# Edit ~/.bash_profile
export GOPATH=/Users/username/go
export PATH=$GOPATH/bin:$PATH
# Reload profile : source ~/.bash_profile
formatDays = function (d) {
var days = Math.floor(d / 86400),
hours = Math.floor((d - (days * 86400)) / 3600),
minutes = Math.floor((d - (days * 86400) - (hours * 3600)) / 60),
seconds = d - (days * 86400) - (hours * 3600) - (minutes * 60);
var output = '';
if (seconds) {
output = seconds + 's';
}
if (minutes) {
@hero9
hero9 / SSL.md
Created January 9, 2019 05:09 — forked from gangsta/SSL.md
How to Setting Up a Comodo SSL Cert

How to Setting Up a Comodo SSL Cert

I advice you to buy SSL Certs from officially Comodo only , or some SSL reseller whose you trust.

These are the steps I went through to set up an SSL cert. Purchase the cert

Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You’ll be asked for the content of the CSR file when ordering the certificate.

@hero9
hero9 / Git push deployment in 7 easy steps.md
Created August 29, 2019 06:11 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook