Skip to content

Instantly share code, notes, and snippets.

@jamiejohnsonkc
jamiejohnsonkc / net start & stop commands
Created Aug 11, 2018
net start / net stop #win, #cmd
View net start & stop commands
net start [serviceName]
and
net stop [serviceName]
tell you whether they have succeeded or failed pretty clearly. For example
U:\>net stop alerter
The Alerter service is not started.
View custom-fields-for-woocommerce.php
<?php
/**
*
* You can find the complete tutorial for this here:
* https://pluginrepublic.com/woocommerce-custom-fields
*
* Alternatively, check out the plugin
* https://pluginrepublic.com/wordpress-plugins/woocommerce-product-add-ons-ultimate/
*
@dixonsiu
dixonsiu / convert_link.py
Last active Apr 27, 2021
Python scripts for Pandoc
View convert_link.py
@dixonsiu
dixonsiu / pandoc_filter_procedures.md
Last active Jun 9, 2021
How to convert markdown link to html using Pandoc
View pandoc_filter_procedures.md

How to convert markdown link to html using Pandoc

Issue

Pandoc cannot convert a link's URL as expected.
Markdown:

[Document](./document.md)

HTML:

<a href="./document.md">Document</a>
View Overloader.php
<?php
/**
* Trait helps to allow for some limited overloading of
* methods in the class this is attached to.
*/
trait Overloader {
/**
@paulirish
paulirish / what-forces-layout.md
Last active Jun 23, 2021
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@hraban
hraban / pre-commit
Last active May 12, 2021
Prevent accidentally committing debug code in Git
View pre-commit
#!/bin/sh
# This pre-commit hook will prevent you from committing any line (or filename) containing
# the string NOCOMMIT. Use that tag in comments around source code you want to avoid
# accidentally committing, like temporary IP addresses or debug printfs.
#
# To add it to an existing repository, save it to .git/hooks/pre-commit (or append, if
# that file already exists). Remember to make executable (chmod +x ...)
#
# To automatically add this pre-commit hook to every repository you create or clone:
@jakzal
jakzal / crawler-edit.php
Last active Apr 26, 2020
Removing nodes with DomCrawler
View crawler-edit.php
<?php
<<<CONFIG
packages:
- "symfony/dom-crawler: ~2.3"
- "symfony/css-selector: ~2.3"
CONFIG;
use Symfony\Component\DomCrawler\Crawler;
$html = <<<HTML
@maxivak
maxivak / 00. tutorial.md
Last active Jun 23, 2021
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
View 00. tutorial.md
@staltz
staltz / introrx.md
Last active Jun 23, 2021
The introduction to Reactive Programming you've been missing
View introrx.md