Skip to content

Instantly share code, notes, and snippets.

View klihelp's full-sized avatar
🎯
Focusing on life and money farm

klihelp

🎯
Focusing on life and money farm
View GitHub Profile
@ayshptk
ayshptk / pages.py
Last active October 4, 2023 20:37
quickly run this script to generate your github pages beautifully. make sure to switch ages rendering to `docs` folder
# make sure to `pip install markdown` before you run this script :)
# generates beautiful html files in `docs` folder for every markdown file in the root folder
import shutil, markdown, os; shutil.rmtree("docs") if os.path.exists("docs") else None; os.mkdir("docs"); [open("docs/" + file.name.replace(".md", ".html"), "w").write('<link href="https://cdn.statically.io/gh/ayshptk/html.css/main/flavor/white.min.css" rel="stylesheet" >\n<meta name="viewport" content="width=device-width, initial-scale=1.0">\n' + markdown.markdown(file.read())) for file in [open(file, "r") for file in [f for f in os.listdir() if f.endswith(".md")]]]
@aamnah
aamnah / sound.js
Last active October 7, 2018 23:12
Web Audio API - Create a sound in browser
// Create an Audio Context
let context = new AudioContext()
// Create an Oscillator
let osc = context.createOscillator()
// Lower the volume
/*
.createGain() represents a change in Volume
It's an `AudioNode` audio-processing module that causes a given 'gain'
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active January 21, 2024 16:28
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@kartikparmar
kartikparmar / functions.php
Last active July 24, 2019 17:35
hide_wc_category_from_shop
<?php
/**
* Show products only of selected category.
*/
function get_subcategory_terms( $terms, $taxonomies, $args ) {
$new_terms = array();
$hide_category = array( 126 ); // Ids of the category you don't want to display on the shop page
@nolanlawson
nolanlawson / index.html
Created April 5, 2018 17:46
-webkit-backdrop-filter repro
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<style>
.profile-grid-wrapper {
-webkit-backdrop-filter: blur(7px) saturate(110%);
backdrop-filter: blur(7px) saturate(110%);
background-color: rgba(255, 255, 255, 0.7);
}
@mattpramschufer
mattpramschufer / gist:957039753ea7a0bc3344e2f817304156
Created December 11, 2017 18:21 — forked from corsonr/gist:7215762
WooCommerce: Hide Checkout Fields For Virtual Products
<?php
add_filter( 'woocommerce_checkout_fields' , 'woo_remove_billing_checkout_fields' );
/**
* Remove unwanted checkout fields
*
* @return $fields array
*/
function woo_remove_billing_checkout_fields( $fields ) {
@cowboy
cowboy / paperclips.js
Last active June 4, 2023 05:29
Universal Paperclips: stuff to paste into console http://www.decisionproblem.com/paperclips
_toggles = {}
makeToggle = (id, fn, delay = 250) => {
const elem = document.querySelector('#' + id)
elem.onclick = () => {
if (_toggles[id]) {
clearInterval(_toggles[id])
_toggles[id] = null
} else {
_toggles[id] = setInterval(() => elem.disabled || fn(), delay)
}
@ghosh
ghosh / micromodal.css
Last active March 21, 2024 16:12
Demo modal styles for micromodal.js and corresponding expected html. If using this, set the `awaitCloseAnimation` in config to true
/**************************\
Basic Modal Styles
\**************************/
.modal {
font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif;
}
.modal__overlay {
position: fixed;
@jgamblin
jgamblin / randommac.applescript
Last active June 12, 2018 23:49
MAC Address Randomization for MacOS
on run {input, parameters}
delay 4
tell application "Terminal"
activate
end tell
tell application "System Events"
delay 0.3
@ahmadawais
ahmadawais / dev_and_production.txt
Last active July 24, 2018 17:54
Gutenberg: v0.50.0 — Cost of Modules — Data Calculation through: https://github.com/siddharthkp/cost-of-modules
cost-of-modules --include-dev --no-install
Calculating...
┌───────────────────────────────────────────┬──────────────┬─────────┐
│ name │ children │ size │
├───────────────────────────────────────────┼──────────────┼─────────┤
│ babel-preset-env │ 147 │ 81.98M │
├───────────────────────────────────────────┼──────────────┼─────────┤