Skip to content

Instantly share code, notes, and snippets.

@rw3iss
rw3iss / launch.js
Last active April 11, 2021 01:35
browsersync script to hot reload any client project
const bs = require('browser-sync').create();
const url = require('url');
const fs = require('fs');
const path = require('path');
const PORT = 3300
const OUTPUT_DIR = './build'
const DEFAULT_FILE = "index.html"
bs.watch(`${OUTPUT_DIR}/**/*.js`, function (event, file) {
@rw3iss
rw3iss / build.js
Last active June 10, 2023 20:29
esbuild.js frontend build script
var fs = require("fs");
var path = require("path");
// Config params (relative to where npm/script is called from):
const APP_BASE = './src';
const ENTRY_FILE = `index.tsx`;
const OUTPUT_DIR = './build';
const OUTPUT_FILE = 'app.js';
const IS_DEV = false;
const TARGET = 'es2018';
@unstppbl
unstppbl / go_time_parsing.md
Last active May 7, 2024 22:06
Parsing custom time layout in Golang

There are some key values that the time.Parse is looking for.

By changing:

test, err := time.Parse("10/15/1983", "10/15/1983")

to

@craigmurray1120
craigmurray1120 / rest-api-code-generator-list.md
Last active November 18, 2022 09:54
List of REST API code generator
@LoyEgor
LoyEgor / gulpfile.js
Last active March 13, 2023 17:22
best image compression settings (gulp-imagemin)
// install
// npm i gulp-cache gulp-imagemin imagemin-pngquant imagemin-zopfli imagemin-mozjpeg imagemin-giflossy -f
// node node_modules/jpegtran-bin/lib/install.js
// node node_modules/gifsicle/lib/install.js
// node node_modules/zopflipng-bin/lib/install.js
// node node_modules/mozjpeg/lib/install.js
// node node_modules/giflossy/lib/install.js
// node node_modules/pngquant-bin/lib/install.js
@BurlesonBrad
BurlesonBrad / functions.php
Created March 10, 2016 21:34 — forked from TimBHowe/functions.php
Reduce or remove WooCommerce 2.5 minimum password strength requirement for creating a user account. Warning: Use at your own risk.
<?php
/**
*Reduce the strength requirement on the woocommerce password.
*
* Strength Settings
* 3 = Strong (default)
* 2 = Medium
* 1 = Weak
* 0 = Very Weak / Anything
*/
@kdzwinel
kdzwinel / main.js
Last active June 7, 2024 08:08
List all undefined CSS classes
/*
This script attempts to identify all CSS classes mentioned in HTML but not defined in the stylesheets.
In order to use it, just run it in the DevTools console (or add it to DevTools Snippets and run it from there).
Note that this script requires browser to support `fetch` and some ES6 features (fat arrow, Promises, Array.from, Set). You can transpile it to ES5 here: https://babeljs.io/repl/ .
Known limitations:
- it won't be able to take into account some external stylesheets (if CORS isn't set up)
- it will produce false negatives for classes that are mentioned in the comments.
@nielsenrc
nielsenrc / shopify-use-shopify-api-to-bulk-import-301-redirects.php
Last active July 13, 2017 00:30
Shopify | PHP | Use Shopify API to Bulk Import 301 Redirects
<?php
// In Shopify go to Apps -> Private Apps to get API Key
// List of Redirects under Online Store -> Navigation -> Redirects
$api_key = "";
$password = "";
$store_subdomain = ""; //
$shopify_url = "https://" . $api_key . ":" . $password . "@" . $store_subdomain . ".myshopify.com/admin/redirects.json";
$array_of_redirects = array (
'[/from-uri]' => '[/to-uri]',
);
@vertexclique
vertexclique / cracking.md
Last active May 11, 2024 21:17
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text

@wesbos
wesbos / is_blog.php
Created September 2, 2011 19:32
WordPress is_blog()
function is_blog () {
global $post;
$posttype = get_post_type($post );
return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ;
}
Usage:
<?php if (is_blog()) { echo 'You are on a blog page'; } ?>