Skip to content

Instantly share code, notes, and snippets.

View igorbabko's full-sized avatar
🇺🇦

Igor Babko igorbabko

🇺🇦
View GitHub Profile
@junagao
junagao / vscode-italic-font-settings.md
Last active January 24, 2024 13:30
VSCode italic font settings

VSCode italic font settings

Add this to settings.json (cmd ,):

{
  "editor.fontFamily": "Operator Mono, Fira Code iScript, Menlo, Monaco, 'Courier New', monospace",
  "editor.fontLigatures": true,
  "editor.tokenColorCustomizations": {
    "textMateRules": [
      {
module.exports = {
config: {
// customizations
scrollback: 40000,
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
// fontFamily: '"Plex Mono", Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
@gaearon
gaearon / minification.md
Last active March 4, 2024 12:45
How to Set Up Minification

In production, it is recommended to minify any JavaScript code that is included with your application. Minification can help your website load several times faster, especially as the size of your JavaScript source code grows.

Here's one way to set it up:

  1. Install Node.js
  2. Run npm init -y in your project folder (don't skip this step!)
  3. Run npm install terser

Now, to minify a file called like_button.js, run in the terminal:

@gaearon
gaearon / modern_js.md
Last active April 18, 2024 15:01
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@vukanac
vukanac / install-php72-osx.md
Created August 20, 2017 19:26
How to install php72 on Mac OS X with homebrew.

Skip this:

brew tap homebrew/dupes
brew tap homebrew/versions

As:

Warning: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.
Warning: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.
@pokap
pokap / assertArraySimilar.php
Last active August 9, 2022 15:08
[PHPunit] assert two arrays are equal, but ignore orders
<?php
trait ArrayTestCaseTrait
{
/**
* Asserts that two associative arrays are similar.
*
* Both arrays must have the same indexes with identical values
* without respect to key ordering
*
@sdieunidou
sdieunidou / rabbitmq.txt
Created October 22, 2015 19:51
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
@JeffreyWay
JeffreyWay / .bash_profile
Created July 31, 2015 19:20
Prettier git logs
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 21, 2024 21:42
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@unbracketed
unbracketed / branch-fu.md
Created April 7, 2015 17:49
Moving commits between branches

Example: Moving up to a few commits to another branch

Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.

cherry-pick does support a range of commits, but if you have merge commits in that range, it gets really complicated

git checkout branch-B
git cherry-pick X
git cherry-pick Y