Skip to content

Instantly share code, notes, and snippets.

View pierrenel's full-sized avatar
:shipit:

Pierre Nel pierrenel

:shipit:
View GitHub Profile
@mikaelz
mikaelz / delete-all-woocommerce-products.php
Last active August 12, 2026 20:00
Remove all WooCommerce products from database via SQL
<?php
require dirname(__FILE__).'/wp-blog-header.php';
$wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')");
$wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'");
$wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)");
$wpdb->query("DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_posts WHERE post_type IN ('product','product_variation')");
@nuomi1
nuomi1 / PrintBootCampESDInfo.swift
Last active August 16, 2026 03:53
macOS and BootCamp Latest
#!/usr/bin/env swift
//
// PrintBootCampESDInfo.swift
//
// Created by nuomi1 on 8/5/18.
// Copyright © 2018年 nuomi1. All rights reserved.
//
import Foundation
@thejmazz
thejmazz / .babelrc
Created February 16, 2016 18:17
async/await with webpack+babel
{
"presets": ["es2015"],
"plugins": ["transform-async-to-generator"]
}
@ben-w-smith
ben-w-smith / font-responsive-mixin.scss
Last active December 5, 2025 21:29
Responsive Font SASS mixin
// SASS mixin duplicating rucksack's cool cool solution on creating responsive font sizes.
//
// The calculation is:
// min-size + (min-size - max-size) * ( (100vw - min-width) / ( max-width - min-width) )
//
@mixin font-responsive($fmin, $fdiff, $breakmin, $breakdiff) {
font-size: calc( #{$fmin} + #{$fdiff} * ((100vw - #{$breakmin}) / #{$breakdiff}) );
@media(max-width: $breakmin) {
font-size: $fmin;
}
@adham90
adham90 / spacemacs-keybindings
Last active December 27, 2025 20:22
spacemacs keybindings that i need to learn
SPC s c remove highlight
**** Files manipulations key bindings
Files manipulation commands (start with ~f~):
| Key Binding | Description |
|-------------+----------------------------------------------------------------|
| ~SPC f c~ | copy current file to a different location |
| ~SPC f C d~ | convert file from unix to dos encoding |
| ~SPC f C u~ | convert file from dos to unix encoding |
@dsdsdsdsdsds
dsdsdsdsdsds / cursor.css
Last active November 1, 2023 11:45
CSS: Cross Browser hires/retina cursor image
.cursor {
cursor: url("cursor.png") 0 0, pointer; /* Legacy */
cursor: url("cursor.svg") 0 0, pointer; /* FF */
cursor: -webkit-image-set(url("cursor.png") 1x, url("cursor@2x.png") 2x) 0 0, pointer; /* Webkit */
}
@rauchg
rauchg / README.md
Last active May 16, 2026 01:17
require-from-twitter
@f5io
f5io / core.js
Last active September 7, 2023 18:38
An approach to async middleware for raw `http` in Node.
const http = require('http');
const methods = [ 'get', 'put', 'post', 'delete', 'head' ];
const isStream = obj =>
obj &&
typeof obj === 'object' &&
typeof obj.pipe === 'function';
const isReadable = obj =>
import React, { Component, } from 'react'
import {
View,
Image,
Text,
Dimensions,
ScrollView,
} from 'react-native'
const {height, width} = Dimensions.get('window')
@sam-artuso
sam-artuso / setting-up-babel-nodemon.md
Last active March 30, 2025 10:24
Setting up Babel and nodemon

Setting up Babel and nodemon

Inital set-up

Set up project:

mkdir project
cd project
npm init -y