Skip to content

Instantly share code, notes, and snippets.

Avatar

Felix Exter felixexter

View GitHub Profile
@felixexter
felixexter / share-wifi-windows.md
Created Oct 9, 2017
Share WiFi from Windows via Virtual WiFi from all connections
View share-wifi-windows.md
netsh wlan set hostednetwork mode=allow ssid="networkname" key="password" keyUsage=persistent

netsh wlan start hostednetwork

netsh wlan stop hostednetwork
@felixexter
felixexter / readme.md
Last active Jul 10, 2019
Undress your Trello links
View readme.md

Undress your Trello links

Before

Before custom script

https://trello.com/c/MMIAzcT1/461-candidates-new-%D1%82%D0%B5%D1%81%D1%82%D0%BE%D0%B2%D0%BE%D0%B5-%D0%B7%D0%B0%D0%B4%D0%B0%D0%BD%D0%B8%D0%B5-%D0%B4%D0%BB%D1%8F-%D0%BC%D0%B8%D0%B4%D0%BB-%D1%81%D0%B8%D0%BD%D1%8C%D0%BE%D1%80
@felixexter
felixexter / Readme.md
Created May 11, 2016 — forked from mxstbr/Readme.md
Enable tab completion for JSX with Emmet in Atom
View Readme.md

Enable tab completion for JSX with Emmet in Atom

This guide assumes you have the emmet and language-babel packages already installed in Atom

Gif of the tab completion working

  1. Open the keymap.cson file by clicking on Atom -> Keymap… in the menu bar
  2. Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
View color-nickname.js
var slackId = 'U02D0FE5H'
var processStyles = str =>
str.replace(/;/g, '!important;').replace(/\.color/g, '#client-ui .color')
window.addEventListener('load', () => {
var interval = setInterval(() => {
var $myStyle = document.getElementById('color_rule_color_' + slackId)
@felixexter
felixexter / better-nodejs-require-paths.md
Created Jan 26, 2016 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js
View better-nodejs-require-paths.md

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@felixexter
felixexter / # Sublime Emmet JSX Reactjs.md
Last active Aug 29, 2015 — forked from max-mykhailenko/# Sublime Emmet JSX Reactjs.md
Sublime text 3. Enable Emmet in JSX files with Sublime React plugin
View # Sublime Emmet JSX Reactjs.md

Problem

  • Using emmet in jsx files
  • Emmet expands text when js autocomplete needed
  • Using className instead of class

How it works

  • Install plugin RegReplace
  • Install plugin Chain Of Command
View killbydir.sh
#!/bin/bash
# add to /usr/local/bin/killbydir
# chmod +x /usr/local/bin/killbydir
path=`pwd`
for process in `pgrep $1`; do
foo=(`pwdx $process`)
if [ ${foo[1]} = $path ]; then
pid=${foo[0]::-1}
`kill -9 $pid`
fi
@felixexter
felixexter / slack-delete-files.js
Last active Oct 18, 2017
slack-delete-files.js
View slack-delete-files.js
function deleteFiles(types = 'all') {
let files = [];
function deleteFilesByTypes(types, page = 1) {
TS.api.call('files.list', {
types,
user: boot_data.user_id,
page
}, (a, data) => {
files = [...files, ...data.files];
@felixexter
felixexter / conventional-selectors-order-in-bem-stylus.md
Created May 28, 2015
Соглашение о порядке селекторов в стиле БЭМ в Stylus
View conventional-selectors-order-in-bem-stylus.md

Соглашение о порядке селекторов в стиле БЭМ в Stylus

На рассмотрении 2 варианта порядка селекторов, у которых есть свои плюсы и минусы.

Вариант 1. Всё, что относится к блоку или элементу, находится в начале

Плюсы

  • Свойства, @media-примеси, псевдоэлементы, псевдоклассы и модификаторы ожидаемо находятся под объявлением класса.
  • Модификаторы и псевдоклассы, влияющие на дочерний селектор, ожидаемо идут следом за этим селектором.
  • Не нужно искать модификаторы и псевдоклассы в начале или конце среди остальных селекторов.