Skip to content

Instantly share code, notes, and snippets.

View parasdaryanani's full-sized avatar

Paras Daryanani parasdaryanani

View GitHub Profile
@manuelfdo
manuelfdo / decode_ecwid_request.js
Last active August 23, 2023 07:35
Example of decoding Ecwid payment request using Web Cryptography API / SublteCrypto. https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto
var bodyData = 'ECWID PAYLOAD';
var clientId = 'YOUR CLIENT SECRET';
// Added required padding to make the payload a multiple of 4. We can do this using a repeat or a simple while.
// var paddingLength = 4 - (bodyData.length % 4);
// if (paddingLength !== 4) {
// bodyData + '='.repeat(paddingLength);
// }
@johnsfuller
johnsfuller / hubspot-hubl.html
Created July 20, 2021 12:32
WordPress/PHP & HubSpot/HubL Comparison Cheat Sheet
<!-- 👇 Scroll down 👇 -->
{# variables #}
{% set my_variable = 'Hello world' %}
{# get variables from somewhere else #}
{% import 'path/to/hubl-variables.html' as site_vars %}
{{ site_vars.my_external_variable }}
<?
# MIT license, do whatever you want with it
#
# This is my invoice.php page which I use to make invoices that customers want,
# with their address on it and which are easily printable. I love Stripe but
# their invoices and receipts were too wild for my customers on Remote OK
#
require_once(__DIR__.'/../vendor/autoload.php');
@davecoutts
davecoutts / make_netatalk-3.1.11_deb.sh
Created May 6, 2018 21:51
Install Netatalk 3.1.11 on Ubuntu 18.04 Bionic
# This gist gives instructions to build a basic deb package of netatalk-3.1.11 using checkinstall on Ubuntu 18.04.
# With the idea being that you build the deb on your build server and install from the resulting deb in production.
# Given that the deb is packaged using checkinstall with basic options, think home use, not real production.
# Note that this build does not provide the spotlight feature.
# The tracker packages have been left out as the intent was to provide TimeMachine functionality only.
#------------------------------------------------------------
# STEP ONE - Make the Netatalk deb on a build machine
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active September 23, 2024 19:40
crack activate Office on mac with license file
@birksy89
birksy89 / Return JSON - DNN Web API
Created March 8, 2017 11:38
Return JSON - DNN Web API
[AllowAnonymous]
[HttpGet]
public HttpResponseMessage GetAllMessages()
{
try
{
//Load Data Into List
var mm = new MessageManager();
List<Message> msgs = mm.GetAllMessages();

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8

@DanDiplo
DanDiplo / JS-LINQ.js
Last active July 19, 2024 03:02
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
@samhotchkiss
samhotchkiss / gitignore-for-wp
Created August 9, 2013 01:35
Basic Gitignore for WordPress
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your