Skip to content

Instantly share code, notes, and snippets.

View yusupova's full-sized avatar
🌆

Albina Yusupova yusupova

🌆
  • Germany
View GitHub Profile
@yusupova
yusupova / sidekiq.service
Created July 8, 2019 22:18
sidekiq sevice ubuntu
#
# systemd unit file for CentOS 7, Ubuntu 15.04
#
# Customize this file based on your bundler location, app directory, etc.
# Put this in /usr/lib/systemd/system (CentOS) or /lib/systemd/system (Ubuntu).
# Run:
# - systemctl enable sidekiq
# - systemctl {start,stop,restart} sidekiq
#
# This file corresponds to a single Sidekiq process. Add multiple copies
@yusupova
yusupova / nginx.conf
Created July 5, 2019 12:41
Nginx config to work on localhost with subdomain
events {
worker_connections 1024;
use epoll;
}
http {
upstream app_proxy {
server lvh.me:3000;
}
@yusupova
yusupova / hidescrollbar.css
Created June 24, 2019 12:30
Dont show scrollbar but able to scroll
.container {
overflow-y: scroll;
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE 10+ */
}
.container::-webkit-scrollbar { /* WebKit */
width: 0;
height: 0;
}
@yusupova
yusupova / checkSoftwareExample.js
Created February 22, 2019 11:48
same software check example
checkSameReadandWrite = (software) =>{
let { sodtwareList } = this.state
const writing = ['ClaroRead','Texthelp Read&Write','WordQ']
let activeSoftNames = softwareList.filter(s => s.isActive).map(s => s.name)
if (writing.includes(software.name) && writing.some(s => activeSoftNames.includes(s))) {
//then it you show an error
}
}
@yusupova
yusupova / UpgradeModalComponent.js
Created February 5, 2019 11:14
Upgarde modal component
import React from 'react'
import Modal from 'components/common/Modal/Modal'
import Button from 'components/common/Button/Button'
import './UpgradeModal.css'
const UpgradeModal = ({onButtonClick, ...props}) => {
return(
<Modal className='UpgradeModal' {...props}>
<div className='content main-bg-theme'>
<div className='images'>
@yusupova
yusupova / UpgradeModal.js
Created February 5, 2019 11:10
upgrade modal
import React, {Component} from 'react'
import { connect } from 'react-redux'
import _UpgradeModal from 'components/UserPage/UpgradeModal/UpgradeModal'
import {closeUpgradeModal} from 'actions/UpgradeModal'
import {push} from 'connected-react-router'
import {SHOP} from 'constants/Location'
class UpgradeModal extends Component {
handleButtonClick = () => {
this.props.closeUpgradeModal()
@yusupova
yusupova / index.html
Created May 30, 2017 14:24
Cross (like close) in css
<div>&times;</div>
@yusupova
yusupova / regex-for-username
Last active April 6, 2017 23:12
Regex for username
^[\w]([A-Za-z0-9]|(\.)(?![._])|(_(?!\.))){2,28}([A-Za-z0-9]|(_(?!\.)))$
[allow numbers, letters, '.' , '_']
[3 - 30 characters]
[cant start with '.', can't have 2 dots one following another]
Examples:
lol.name [ok]
lol name [not ok]
lol,name [not ok ]
@yusupova
yusupova / nginx-for-websoket-failure.conf
Created March 25, 2017 19:06
Error during WebSocket handshake: Unexpected response code: 400
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
# Usually it only needs to add these lines, as we probably have other ones been set
#
@yusupova
yusupova / rails-puma.service
Created January 28, 2017 12:27
systemd service to start your Rails app with Puma
# /etc/systemd/system/rails-puma.service
# rvm wrapper default systemd rails
# systemctl enable rails-puma
# systemctl start rails-puma
[Unit]
Description=Rails Puma Webserver
Wants=network-online.target
After=network.target network-online.target