Skip to content

Instantly share code, notes, and snippets.

View m-pokrovskii's full-sized avatar

Maxim Pokrovskii m-pokrovskii

View GitHub Profile
@abobija
abobija / wsl2-ubuntu-lamp.md
Last active May 3, 2024 12:10
LAMP stack on WSL2 (Ubuntu 20.04) - Apache, MySQL, PHP, PhpMyAdmin

LAMP stack on WSL2 (Ubuntu 20.04) - Apache, MySQL, PHP, PhpMyAdmin

Apache

sudo apt-get update && sudo apt-get upgrade 
sudo apt-get install -y apache2

PHP

/**
*
* Gulpfile setup
*
* @since 1.0.0
* @authors Ahmad Awais, @digisavvy, @desaiuditd, @jb510, @dmassiani and @Maxlopez
* @package neat
* @forks _s & some-like-it-neat
*/
@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@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
@dbranes
dbranes / functions.php
Last active November 3, 2017 12:56
Multiple comment forms and lists in single.php - wpquestions.com #9749
/**
* Example how to setup up multiple comment forms and comments lists
*
* @version 0.0.5
* @file functions.php
* @see http://www.wpquestions.com/question/showLoggedIn/id/9749
*/
/**
@sunriseweb
sunriseweb / acf5_get_acf_field_groups_by_cpt.php
Last active May 18, 2021 08:11
Get ACF (Advanced Custom Field) field groups with their fields for a given custom post type. i.e. where the ACF location rule is "post_type == cpt".
/**
* Returns an array of field groups with fields for the passed CPT, where field group ACF location rule of "post_type == CPT" exists.
* - each field group points at an array of its fields, in turn pointed at an array of that field's detailed information:
* - array of info for each field [ ID, key, label, name, type, menu_order, instructions, required, id, class, conditional_logic[array()], etc. ]
*
* @since 1.0.0
*/
function get_acf_field_groups_by_cpt($cpt) {
// need to create cache or transient for this data?
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 4, 2024 21:33
A badass list of frontend development resources I collected over time.
@honza
honza / description.md
Last active January 4, 2022 00:54
Ranking algorithm - Lower bound of Wilson score confidence interval for a Bernoulli parameter All implementations use 95% probability.

Ranking algorithm

Lower bound of Wilson score confidence interval for a Bernoulli parameter

All implementations use 95% probability.

pos is the number of positive votes, n is the total number of votes.

Source

@dwayne
dwayne / a-modern-frontend-dev.md
Last active March 21, 2021 11:38
Articles, tutorials and tools for modern front-end development.

Problem: What does a Modern Front-End Development Workflow Look Like?

I want to start writing libraries and large applications using the JavaScript language. However, I don't know how to setup the project and which build tools to use. What I do know is that the JavaScript community has moved way beyond using browser developer tool plugins and strategically-placed console.log() statements to debug, test, and build code.

I need help.

Below, I will keep track of articles, tutorials and tools I come across as I search for a way to bring my front-end development chops up-to-date.

The Ultimate Resource