Skip to content

Instantly share code, notes, and snippets.

View 2bj's full-sized avatar
🏠
Working from home

Bakyt 2bj

🏠
Working from home
View GitHub Profile
@2bj
2bj / wget.txt
Created July 2, 2020 10:36 — forked from iAugur/wget.txt
wget spider cache warmer
wget --spider -o wget.log -e robots=off -r -l 5 -p -S -T3 --header="X-Bypass-Cache: 1" -H --domains=live-mysite.mydomain.com --show-progress live-mysite.mydomain.com
# Options explained
# --spider: Crawl the site
# -o wget.log: Keep the log
# -e robots=off: Ignore robots.txt
# -r: specify recursive download
# -l 5: Depth to search. I.e 1 means 'crawl the homepages'.  2 means 'crawl the homepage and all pages it links to'...
# -p: get all images, etc. needed to display HTML page
# -S: print server response (to the log)
@2bj
2bj / homebrew-permissions.sh
Created February 17, 2019 22:03 — forked from jrenggli/homebrew-permissions.sh
Fix homebrew permissions
sudo chown -R $(whoami) /usr/local/Cellar
sudo chown -R $(whoami) /usr/local/Homebrew
sudo chown -R $(whoami) /usr/local/var/homebrew
sudo chown -R $(whoami) ${HOME}/Library/Caches/Homebrew
sudo chown -R $(whoami) ${HOME}/Library/Logs/Homebrew
sudo chown -R $(whoami) /usr/local/etc
sudo chown -R $(whoami) /usr/local/opt
sudo chown -R $(whoami) /usr/local/bin
sudo chown -R $(whoami) /usr/local/var
sudo chown -R $(whoami) /usr/local/share/man/man1
@2bj
2bj / how-to-set-up-stress-free-ssl-on-os-x.md
Created January 28, 2019 14:24 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@2bj
2bj / metro.sql
Created October 10, 2017 13:18 — forked from anonymous/metro.sql
Таблица станций московского метро
-- phpMyAdmin SQL Dump
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@2bj
2bj / mobile_codes.ru.js
Last active April 8, 2017 00:58
Коды сотовых операторов РФ
const codes = [
900, 901, 902, 903, 904, 905, 906, 908, 909, 910, 911, 912, 913, 914, 915,
916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930,
931, 932, 933, 934, 936, 937, 938, 939, 941, 950, 951, 952, 953, 958, 960,
961, 962, 963, 964, 965, 966, 967, 968, 969, 977, 978, 980, 981, 982, 983,
984, 985, 986, 987, 988, 989, 991, 992, 993, 994, 995, 996, 999
];
@2bj
2bj / YandexMap.vue
Created March 22, 2017 21:37 — forked from reg2005/YandexMap.vue
YandexMap wrapper for VueJS 2
<template>
<div class="col-xs-12" style="padding:0;">
<div class="panel panel-default" style="margin:0;">
<div class="panel-body" style="padding:0;">
<div v-if="maps.length" :style="{height: height + 'px'}" id="map"></div>
<h3 v-else class="text-center">Нет точек</h3>
</div>
</div>
</div>
</template>
@2bj
2bj / post-0.md
Last active January 8, 2017 22:22
Post #0

Content

@2bj
2bj / blog.md
Last active January 8, 2017 22:11

Hello World

{
"always_show_minimap_viewport": false,
"bold_folder_labels": false,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"folder_exclude_patterns":
[
".idea",
".git"
],
"caret_style": "phase",

Multiple MySQL Versions with Homebrew

For homebrew version 0.9.5.

brew -v # => Homebrew 0.9.5

Install the current version of mysql.

# Install current mysql version

brew install mysql