Skip to content

Instantly share code, notes, and snippets.

@erickoledadevrel
erickoledadevrel / UnmergedRanges.gs
Last active May 1, 2024 10:08
[Apps Script] Getting the unmerged ranges within a range
/**
* Gets all the unmerged ranges within a range.
* @param {SpreadsheetApp.Range} range The range to evaluate.
* @returns {SpreadsheetApp.Range[]} The unmerged ranges.
*/
function getUnmergedRanges(range) {
if (!range.isPartOfMerge()) {
return [range];
}
var mergedRanges = range.getMergedRanges();
@LukeZGD
LukeZGD / ios-downgrade-dualboot.md
Last active May 1, 2024 10:07
Downgrade and dualboot status of almost all iOS devices

Downgrade and dualboot status of almost all iOS devices

UPDATED: 2024-04-09

@kxttens
kxttens / smol.css
Last active May 1, 2024 10:06
A theme that makes Discord friendlier to smaller window widths.
:root {
--collapsed-sidebar-width: 48px;
--collapsed-member-list-width: 48px;
--sidebar-width: 240px;
--ui-margin-value: 10px;
--ui-floating-radius: 8px;
}
[class^=base_]>[class^=content_]>[class^=sidebar_] {
width: var(--collapsed-sidebar-width);
@Dawn-India
Dawn-India / Deploy With CLI
Last active May 1, 2024 10:04
Heroku Deploy
- Install CLI using official docs: https://devcenter.heroku.com/articles/heroku-cli
- Clone this repo: git clone https://gitlab.com/Dawn-India/Z-Mirror Z-Mirror/ && cd Z-Mirror
- Switch to deploy branch: git checkout hk_deploy
- Now add your config and all other private files.
- After adding your private files: git add . -f
@btm
btm / gist:6700524
Last active February 26, 2024 01:10
Why curl | sudo bash is good: it is simple single line, and uses the same channel that downloading a repository signing key would.

Easy one line Chef installation for all platforms (except windows)

curl https://www.opscode.com/chef/install.sh | sudo bash

That's it. This can be put in any instructions, such as a README or someone's blog, since the logic is in the shell script. Provided you download the script using https, the file has standard levels of authentication and encryption protecting it from manipulation.

This is obviously a shell script, if you're really concerned about the argument that it may contain nefarious activities within, you can easily review it before you run it.

@djoudi
djoudi / axios_to_fetch.js
Last active May 1, 2024 10:03 — forked from mp035/axios_to_fetch.js
Replace axios requests with fetch interface.
//This adds axios.get, axios.post, axios.put, and axios.delete compatible methods to
//the global namespace. It is intened for json transactions.
let token = document.head.querySelector('meta[name="csrf-token"]');
class HTTPError extends Error {
constructor(response, ...params) {
// Pass remaining arguments (including vendor specific ones) to parent constructor
super(...params);
#unified-extensions-view {
--uei-icon-size: 16px;
.unified-extensions-item {
margin-block: 0 !important;
border-radius: var(--arrowpanel-menuitem-border-radius) !important;
> .unified-extensions-item-action-button {
.unified-extensions-item-message-deck {
display: none;
@kissarat
kissarat / russian-mnemonic-words.txt
Last active May 1, 2024 09:57
Список существительных русского языка
ад
ар
ер
ил
ом
ум
ус
юг
юр
ют

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

@andrewlimaza
andrewlimaza / add-compatibility-for-sed-and-pmpro-woo.php
Created May 19, 2023 04:56
Add compatibility for PMPro Set Expiration Date Add On and PMPro WooCommerce Add On.
<?php
/**
* Support Set Expiration Date Add On for PMPro WooCommerce Add On.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmprowoo_set_expiration_date( $level_array ) {
// Make sure Set Expiration Date Add On is active.
if ( ! function_exists( 'pmpro_getSetExpirationDate' ) ) {
return $level_array;