Skip to content

Instantly share code, notes, and snippets.

View stavrossk's full-sized avatar
🎯
Focusing

Stavros Skamagkis stavrossk

🎯
Focusing
View GitHub Profile
@stavrossk
stavrossk / Functions.php
Created June 24, 2023 17:57
WooCommerce Filter Hook to Make checkout addresses fields not required in WooCommerce. All code goes in functions.php file of your active child theme.
// Billing and shipping addresses fields
add_filter( 'woocommerce_default_address_fields' , 'filter_default_address_fields', 20, 1 );
function filter_default_address_fields( $address_fields )
{
// Only on checkout page
if( ! is_checkout() ) return $address_fields;
// All field keys in this array
@echo off
IF NOT EXIST %WINDIR%\System32\GroupPolicy goto next
echo Deleting GroupPolicy folder...
RD /S /Q "%WINDIR%\System32\GroupPolicy" || goto error
echo.
:next
IF NOT EXIST %WINDIR%\System32\GroupPolicyUsers goto next2
@mutsune
mutsune / CustomStringEscapeUtil.java
Created December 6, 2018 03:46
(Part of) custom apache commons StringEscapeUtil like PHP htmlspecialchars
final private static CharSequenceTranslator quotes = buildAggregateTranslator(Mode.ENT_QUOTES);
final private static CharSequenceTranslator noquotes = buildAggregateTranslator(Mode.ENT_NOQUOTES);
private static AggregateTranslator buildAggregateTranslator(Mode mode) {
Map<CharSequence, CharSequence> map = new HashMap<>();
if (mode == Mode.ENT_QUOTES) {
map.put("\"", "&quot;"); // " - double-quote
map.put("'", "&apos;"); // ' - apostrophe
}
@travelingtonic
travelingtonic / Simple-Gets
Created December 6, 2018 03:44
Simple GET Requests Assignments
Assignments
1. Create an app that lets users choose to display between 1 and 50 random dog images, then prints the results to the console. The app should feature a form with a required input where users indicate the number of images to retrieve, and the input should default to 3. Use the endpoint described in the "DISPLAY MULTIPLE RANDOM IMAGES FROM ALL DOGS COLLECTION" section of this page of the DogAPI docs.
https://repl.it/@travelingtonic/simple-get-assignment-1
2. Building on the previous app, create an app that lets users choose to display between 1 and 50 random dog images, then loads the images in the console. This app should adhere to all of the requirements from the first one, in addition to displaying the images in the DOM.
https://repl.it/@travelingtonic/simple-get-assignment-2
3. Create an app that loads a single random image for a specific breed. This app should account for the happy case when the breed is found, as well as the unhappy case when it is not. Use the endpoint described in th
On MacOS terminal
===============
1. Run the following command to install the express generator
~ sudo npm install express-generator -g
2. Create a folder for the application
~ mkdir azurenodejsapp
~ cd azurenodejsapp
@sooryan
sooryan / blake2.md
Last active March 12, 2024 02:37
A quick summary of blake2, a cryptographic hash function

BLAKE2

  • BLAKE2 is an improved version of the SHA-3 finalist BLAKE, and was designed by a team of experts in cryptanalysis, implementation, and cryptographic engineering; namely Jean-Philippe Aumasson, Samuel Neves, Zooko Wilcox-O'Hearn and Christian Winnerlein.

  • BLAKE2s (the one checksum currently uses) computes a message digest that is 256 bits long, and represented as a 64-character hexadecimal number, e.g. 4264cb256d94533b6e152da59256638bc6adfda3efc5550d7607d4e6e45592fc.

Types

  • BLAKE2b (or just BLAKE2) is optimized for 64-bit platforms and produces digests of any size between 1 and 64 bytes.
@helgatheviking
helgatheviking / woocommerce-shipping-contact.php
Last active June 7, 2023 11:34
Add a shipping email/phone field to checkout and notify of new orders
<?php
/*
Plugin Name: WooCommerce Shipping Contact
Plugin URI: https://github.com/helgatheviking/wc-shipping-contact
Description: Add a shipping email field to checkout and notify of new orders
Version: 1.1.0
Author: Kathy Darling
Author URI: http://kathyisawesome.com
Requires at least: 4.0
Tested up to: 4.8
@sim642
sim642 / DI.m3u
Created July 5, 2015 12:52
Digitally Imported premium streams
#EXTM3U
#EXTINF:-1,Digitally Imported - Ambient
http://pub1.diforfree.org:8000/di_ambient_hi
#EXTINF:-1,Digitally Imported - Big Room House
http://pub1.diforfree.org:8000/di_bigroomhouse_hi
#EXTINF:-1,Digitally Imported - Breaks
http://pub1.diforfree.org:8000/di_breaks_hi
@danielpataki
danielpataki / activation.php
Last active February 22, 2021 16:21
WordPress Custom Database Tables
register_activation_hook( __FILE__, 'my_plugin_create_db' );
function my_plugin_create_db() {
// Create DB Here
}
@staltz
staltz / introrx.md
Last active May 6, 2024 01:44
The introduction to Reactive Programming you've been missing