Skip to content

Instantly share code, notes, and snippets.

View KennyStier's full-sized avatar

Kenny Stier KennyStier

View GitHub Profile
let liturgyToday = {};
$.getJSON('https://www.johnromanodorazio.com/LiturgicalCalendar/LitCalEngine.php?diocesanpreset=DIOCESIDIROMA',function(data){
for(const [key,entry] of Object.entries(data.LitCal)){
let entryDate = new Date(entry.date * 1000);
if(entryDate.getUTCMonth() == new Date().getMonth() && entryDate.getUTCDate() == new Date().getDate()){
liturgyToday[key] = entry;
}
}
});
@gaiqus
gaiqus / WPDeskNoShippingMessage
Created November 10, 2020 14:13
Change the “No Shipping methods available” Message in WooCommerce
class WPDeskNoShippingMessage {
/**
* Register hooks.
*/
public function add_hooks() {
add_filter( 'woocommerce_no_shipping_available_html', [ $this, 'change_message' ] );
add_filter( 'woocommerce_cart_no_shipping_available_html', [ $this, 'change_message' ] );
}
/**
@nethunteros
nethunteros / apt-cache-ng.sh
Created March 12, 2017 15:51
apt-cacher-ng setup server
#!/bin/sh
# Install apt-cacher-ng
apt-get install -y apt-cacher-ng
# This will be a caching server on local network. Change IP to private or leave listening
echo "BindAddress: 0.0.0.0" >> /etc/apt-cacher-ng/acng.conf
echo "Port:3142" >> /etc/apt-cacher-ng/acng.conf
echo "PidFile: /var/run/apt-cacher-ng/pid" >> /etc/apt-cacher-ng/acng.conf
@0xjac
0xjac / private_fork.md
Last active November 17, 2024 15:31
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@geerlingguy
geerlingguy / dashcam-time-lapse.sh
Last active August 10, 2023 06:06
Create a time lapse video from a set of real-time dash cam clips.
#!/bin/bash
#
# Batch Time-Lapse creation script.
#
# This script can be used to speed up, trim, and finally concatenate tens or
# even hundreds of video clips, e.g. from a dash cam. You can do other things,
# too, but the main things this script does include:
#
# 1. Copy across and speed up video clips from an input dir to an output dir.
# 2. Trim off the first x frames of each of the copied/sped up clips.
@deverton
deverton / gargoyle-host-override.md
Last active January 5, 2018 01:13
Host Overrides in Gargoyle/OpenWRT
  1. SSH to router
  2. uci add_list dhcp.@dnsmasq[0].addnhosts=/etc/override.hosts
  3. echo 'fqdn.example.com 127.0.0.1' >> /etc/override.hosts
  4. /etc/init.d/dnsmasq restart

Should result in

  $ nslookup fqdn.example.com
 Server: 127.0.0.1
@whatnickcodes
whatnickcodes / base64.js
Created April 24, 2014 15:01
How to Encode and Decode Strings with Base64 in JavaScript
// Create Base64 Object
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r
@corsonr
corsonr / gist:7597370
Created November 22, 2013 09:38
Add Order Notes To WooCommerce Completed Order Email (add to customer-completed-order.php)
<h2><?php _e( 'Order Notes', 'woocommerce' ); ?></h2>
<?php
$args = array(
'status' => 'approve',
'post_id' => $order->id
);
$comments = get_comments($args);
foreach($comments as $comment) :
echo $comment->comment_content . '<br />';
@philipn
philipn / gist:1148693
Created August 16, 2011 08:59
GeoTIFFs -> One Big GeoTIFF
"""
Likely not useful to anyone else, but just putting it out there.
This script will take a directory of GeoTIFFs and merge them together without issues.
This script simply decompresses the files, runs nearblack to remove pseudo-black borders caused by compression, and then uses gdalwarp to stitch the files together.
The script is designed to use the minimal amount of disk space possible -- it cleans up each file after decompression and continually merges with a master image.
"""
import os