Skip to content

Instantly share code, notes, and snippets.

@Gennnji
Gennnji / 0_reuse_code.js
Created September 25, 2017 13:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
1. ^[^\-]|(?<!^)[^\d\.] - Search for every symbol except digits and first minus
@Gennnji
Gennnji / containers_App.js
Created January 11, 2019 15:54
Install React from Scratch
import React, {Component} from 'react';
export default class App extends Component {
render () {
return <p>This is my new react app</p>
}
}
@Gennnji
Gennnji / .zshrc
Last active February 4, 2019 09:43
Installing oh-my-zsh
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/genji/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@Gennnji
Gennnji / composer-install.sh
Last active February 19, 2019 13:50
Install tools on Ubuntu
#!/bin/sh
EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
#!/bin/sh -e
# 1) Disable of gnome control over keyboard:
gsettings set org.gnome.settings-daemon.plugins.keyboard active false
# 2) Set desired settings for xkb:
setxkbmap -option grp:rctrl_toggle,lv3:menu_switch us,ru
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="${HOME}/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@Gennnji
Gennnji / Web-IE11-fixes.txt
Last active October 9, 2019 12:25
Frontend Development for IE11
1. Problems with inactive margin of elements inside flexbox.
Solution: Add pseudo-element ::after like
.element::after {
content: '';
display: block;
height: 20px;
}
2. Undesired phone number detection on a page with odd styling.
Solution: Add meta into head - <meta name="format-detection" content="telephone=no">.
@Gennnji
Gennnji / index.html
Created October 1, 2019 10:20
[CSS] Dynamical comma
<style>
span:not(:empty) + span:not(:empty):before {
content: ', ';
}
</style>
<span>+7 (985) 171-71-71</span><span>test@mail.mail</span>
<!--
Outputs to ===> +7 (985) 171-71-71, test@mail.mail
@Gennnji
Gennnji / setup.sh
Created December 30, 2019 08:50
MacOS setup
# setup oh-my-zshell
# setup Sublime Text 3
mkdir ~/bin
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl