Skip to content

Instantly share code, notes, and snippets.

@sarahcssiqueira
sarahcssiqueira / webpack dependencies
Last active December 4, 2024 21:41
webpack.config.js for WordPress projects
{
"devDependencies": {
"@babel/cli": "^7.22.9",
"@babel/core": "^7.22.9",
"@babel/preset-env": "^7.22.9",
"@babel/preset-react": "^7.22.5",
"babel-loader": "^9.1.2",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^11.0.0",
"cross-env": "^7.0.3",
@pjobson
pjobson / preyosemite_usb_stick_creation.md
Last active November 26, 2025 04:41
How to Create a Bootable OS X USB Stick Pre-Yosemite

Pre-Yosemite USB Stick Creation

Yosemite and later used a built in program called createinstallmedia to automagically make a USB stick. It is possible to create a bootable USB stick without this program.

You'll need an 8GB USB stick and either the Install Mac OS X Lion.app or InstallESD.dmg or BaseInstall.dmg.

Open Terminal, you'll need it in most of this tutorial.

We're going to need to start by getting to the actual installation disk image.

@a-barbieri
a-barbieri / loop-per-pyetro.php
Last active November 11, 2019 14:28
Per Pyetro
<?php if (have_posts()): ?>
<ul id="image-data-list">
<?php while(have_posts()): the_post(); ?>
<li data-image-url="<?= your_post_image_url ?>"></li>
<?php endwhile; ?>
</ul>
<?php endif; ?>

Shortcuts on Mac Terminal

  • Tab Auto-complete file and folder names
  • Ctrl + A Go to the beginning of the line you're currently typing on
  • Ctrl + E Go to the end of the line you're currently typing on
  • Ctrl + U Clear the line before the cursor
  • Ctrl + K Clear the line after the cursor
  • Ctrl + W Delete the word before the cursor
  • Ctrl + T Swap the last two characters before the cursor
  • Esc + T Swap the last two words before the cursor
@subfighter3
subfighter3 / osx-setup.sh
Created February 4, 2019 15:42 — forked from somebox/osx-setup.sh
Set up an OSX machine from zero to awesome. Uses Homebrew (and cask, fonts, etc). Focused on Ruby/Rails development, includes rvm, xquartz, editor fonts, sublime text, and many tools.
#!/bin/bash
# A script to set up a new mac. Uses bash, homebrew, etc.
# Focused for ruby/rails development. Includes many utilities and apps:
# - homebrew, rvm, node
# - quicklook plugins, terminal fonts
# - browsers: chrome, firefox
# - dev: iterm2, sublime text, postgres, chrome devtools, etc.
# - team: slack, dropbox, google drive, skype, etc
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active August 3, 2026 00:56
Conventional Commits Cheatsheet
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active June 24, 2026 07:05
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@iksi
iksi / hex-to-hsl.php
Created April 18, 2018 10:44
convert hex to hsl
<?php
// http://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl/
// convert hex to hsl
$hex = str_split(ltrim('#0099cc', '#'), 2);
// convert the rgb values to the range 0-1
$rgb = array_map(function($part) {
return hexdec($part) / 255;
@carasmo
carasmo / for-include-or-functions.php
Created January 29, 2018 18:08
Add Custom Post Type and Taxonomy Terms to wp_link_query. Link search function in WordPress editor add Custom Post Types and Taxonomy Terms
<?php
//don't re add the php tag above
add_filter('wp_link_query', 'cab_add_custom_post_type_archive_link', 10, 2);
/**
* Add Custom Post Type archive to WordPress search link query
* Author: https://github.com/mthchz/editor-archive-post-link/blob/master/editor-archive-post-link.php
*/
function cab_add_custom_post_type_archive_link( $results, $query ) {
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active August 2, 2026 23:45
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example