Skip to content

Instantly share code, notes, and snippets.

View fitzmode's full-sized avatar

Anesu Fitz Muzenda fitzmode

View GitHub Profile
@fitzmode
fitzmode / select-text-woo-checkoutt.php
Created October 26, 2018 17:26 — forked from mchrislay/select-text-woo-checkoutt.php
Add Select Radio Buttons + Text Field option to WooCommerce Checkout Page
<?php
/**
* Outputs a rasio button form field
*/
function woocommerce_form_field_radio( $key, $args, $value = '' ) {
global $woocommerce;
$defaults = array(
'type' => 'radio',
'label' => '',
@muralikg
muralikg / background.js
Last active June 8, 2023 09:19
puppeteer screen capture demo. Currently records 10 second video. Change the timeout in background.js with your own logic to stop the recording when necessary. Try with `node export.js`
/* global chrome, MediaRecorder, FileReader */
chrome.runtime.onConnect.addListener(port => {
let recorder = null
port.onMessage.addListener(msg => {
console.log(msg);
switch (msg.type) {
case 'REC_STOP':
console.log('Stopping recording')
if (!port.recorderPlaying || !recorder) {
@JuanJo4
JuanJo4 / app.js
Last active September 26, 2020 21:53
Twitter OAuth with node-oauth for node.js + express 4
/*
Node.js, express, oauth example using Twitters API
Install Dependencies:
npm install express
npm install oauth
Create App File:
Save this file to app.js
@subfuzion
subfuzion / curl.md
Last active June 29, 2024 16:04
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active June 22, 2024 03:44
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@vvo
vvo / video-snapshots-sprites.sh
Created July 15, 2013 14:28
generate sprites of video snapshots
sudo aptitude install ffmpeg
sudo aptitude install imagemagick
# fps=1 > every seconds
ffmpeg -i video.mp4 -f image2 -vf fps=fps=1 out%d.png
# horizontal sprite, resized at 30%
convert -resize 30% +append out*.png sprite-1-sec.png
# references:
@claudiosanches
claudiosanches / add-to-cart.php
Last active October 18, 2023 14:02
WooCommerce - Template add-to-cart.php with quantity and Ajax!
<?php
/**
* Custom Loop Add to Cart.
*
* Template with quantity and ajax.
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
global $product;
#!/usr/bin/env sh
VBOX_LATEST_VERSION=$(curl http://download.virtualbox.org/virtualbox/LATEST.TXT)
wget -c http://download.virtualbox.org/virtualbox/${VBOX_LATEST_VERSION}/VBoxGuestAdditions_${VBOX_LATEST_VERSION}.iso -O /tmp/VBoxGuestAdditions_${VBOX_LATEST_VERSION}.iso
sudo mkdir -p /media/guestadditions ; sudo mount -o loop /tmp/VBoxGuestAdditions_${VBOX_LATEST_VERSION}.iso /media/guestadditions
sudo /media/guestadditions/VBoxLinuxAdditions.run
sudo umount /media/guestadditions && sudo rm -rf /tmp/VBoxGuestAdditions_$VBOX_VERSION.iso /media/guestadditions
echo 'You may safely ignore the message that reads: "Could not find the X.Org or XFree86 Window System."'
@Demeter
Demeter / pls2audio.html
Created February 22, 2012 00:11 — forked from Offbeatmammal/pls2audio.html
HTML5 and JavaScript to load a *.pls file to <audio> tag. Uses error and ended events to move to the next item
<! DOCTYPE html>
<html>
<head>
<title>PLS Processor</title>
<!-- needed for IE9 to ensure it treats page as HTML5 properly -->
<meta http-equiv="X-UA-Compatible" content="IE=9" >
</head>
<body>
<p>Audio PLS processor<p>
<audio id="audio" controls="controls"></audio >
@unixcharles
unixcharles / nginx.conf
Last active June 1, 2024 13:34
nginx config for http/https proxy to localhost:3000
#user nobody;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;