Skip to content

Instantly share code, notes, and snippets.

View pierrenel's full-sized avatar
:shipit:

Pierre Nel pierrenel

:shipit:
View GitHub Profile
@adham90
adham90 / spacemacs-keybindings
Last active September 12, 2024 20:41
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 |
@ben-w-smith
ben-w-smith / font-responsive-mixin.scss
Last active October 31, 2022 11:48
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;
}
@thejmazz
thejmazz / .babelrc
Created February 16, 2016 18:17
async/await with webpack+babel
{
"presets": ["es2015"],
"plugins": ["transform-async-to-generator"]
}
@nuomi1
nuomi1 / PrintBootCampESDInfo.swift
Last active March 28, 2025 20:13
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
@mikaelz
mikaelz / delete-all-woocommerce-products.php
Last active November 22, 2024 14:08
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')");
@Avaq
Avaq / combinators.js
Last active March 18, 2025 22:17
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@agladky
agladky / TodoistOverdue.py
Created January 11, 2016 13:36
Moving overdue tasks for today in todoist
# -*- coding: utf-8 -*-
import sys
from todoist import TodoistAPI
from datetime import datetime
from datetime import timedelta
from datetime import timezone
from os.path import expanduser
import argparse
import configparser
@staaldraad
staaldraad / Dockerfile
Last active June 6, 2018 14:20
Use Docker to run @sensepost Mana like a hipster
# Mana-toolkit from @sensepost
#
# VERSION 0.1
FROM ubuntu
MAINTAINER Etienne Stalmans, [email protected]
RUN apt-get update && apt-get install -y \
unzip \
@danharper
danharper / gulpfile.js
Last active September 25, 2024 09:04
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@azinasili
azinasili / px-to-em.scss
Last active August 1, 2023 22:14
Convert px values to em
// Functions and mixin to convert `px` values into `em` units
//
// px-to-em can easily be changed to `rem` values
// Change any instance of `em` to `rem`
//
// EXAMPLE:
// .foo {
// @include em(margin, 10px auto);
// padding: em(1px 2 3px 4);
// }