Skip to content

Instantly share code, notes, and snippets.

@fabiocicerchia
fabiocicerchia / combos.php
Last active May 1, 2024 22:02 — forked from farinspace/combos.php
PHP - Generate all the possible combinations among a set of nested arrays.
/**
* Generate all the possible combinations among a set of nested arrays.
*
* @param array $data The entrypoint array container.
* @param array $all The final container (used internally).
* @param array $group The sub container (used internally).
* @param mixed $val The value to append (used internally).
* @param int $i The key index (used internally).
*/
function generate_combinations(array $data, array &$all = array(), array $group = array(), $value = null, $i = 0)
@marioloncarek
marioloncarek / collection-blocks.liquid
Created September 5, 2018 09:18
Shopify collection blocks
<section class="collection-blocks">
{% for block in section.blocks %}
{%- assign collection = collections[block.settings.collection] -%}
{% if block.settings.collection-title != blank %}
<h2 class="collection-blocks__collection-title">{{ block.settings.collection-title | escape }}</h2>
{% else %}
<h2>{{ collection.title }}</h2>

Converting audio to AAC with Fraunhofer FDK AAC (libfdk_aac) in FFmpeg

Check if you have an FFmpeg build supporting libfdk_aac

Run:

ffmpeg -hide_banner -h encoder=libfdk_aac
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 1, 2024 21:54
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@joelotz
joelotz / cue2labels.py
Last active May 1, 2024 21:51
Convert a music .cue file into a label file. This module will accept an optional string attribute that specifies the input .cue file. If this file is not provided in the call then file-select box will be presented to the user. Output is a .txt file of labels that can be input into Audacity.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Convert a music .cue file into a label file.
This module will accept an optional string attribute that specifies the input
.cue file. If this file is not provided in the call then file-select box will
be presented to the user. Output is a .txt file of labels that can be input
into Audacity.
Examples:
@obsoke
obsoke / FYT_Rust_Notes.md
Created January 4, 2017 04:06
Fix Your Timestep Notes - Rust Style

Simple: Fixed Delta Time

let mut t: 0.0;
let dt = 1.0 / 60.0;

loop {
    update(t, dt);
    render();
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@ychaouche
ychaouche / Spamassassin rules description
Last active May 1, 2024 21:50
Spamassassin rules description
1 AC_BR_BONANZA Too many newlines in a row... spammy template
2 ACCESSDB Message would have been caught by accessdb
3 ACCT_PHISHING_MANY Phishing for account information
4 AC_DIV_BONANZA Too many divs in a row... spammy template
5 AC_FROM_MANY_DOTS Multiple periods in From user name
6 AC_HTML_NONSENSE_TAGS Many consecutive multi-letter HTML tags, likely nonsense/spam
7 AC_POST_EXTRAS Suspicious URL
8 AC_SPAMMY_URI_PATTERNS10 link combos match highly spammy template
9 AC_SPAMMY_URI_PATTERNS11 link combos match highly spammy template
10 AC_SPAMMY_URI_PATTERNS12 link combos match highly spammy template
@thecodewarrior
thecodewarrior / App Icon Template.svg
Last active May 1, 2024 21:50
An SVG template for creating macOS app icons, including guides and the standard drop shadow
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JustinMcNamara74
JustinMcNamara74 / UserPermissions.sql
Last active May 1, 2024 21:49
#MSSQL List all user permissions/roles for all users
/*
********************************************************************************************************************************
Credits: @Jeremy
Posted: http://stackoverflow.com/questions/7048839/sql-server-query-to-find-all-permissions-access-for-all-users-in-a-database
********************************************************************************************************************************
Security Audit Report
1) List all access provisioned to a sql user or windows user/group directly
2) List all access provisioned to a sql user or windows user/group through a database or application role
3) List all access provisioned to the public role