Skip to content

Instantly share code, notes, and snippets.

@kasparsd
kasparsd / wordpress-plugin-svn-to-git.md
Last active June 2, 2025 17:14
Using Git with Subversion Mirroring for WordPress Plugin Development
@pies
pies / ExcelFormulas.js
Created November 29, 2012 04:55
Few Excel formulas - PMT, PPMT, XIRR - expressed in Javascript
/* Based on
* - EGM Mathematical Finance class by Enrique Garcia M. <[email protected]>
* - A Guide to the PMT, FV, IPMT and PPMT Functions by Kevin (aka MWVisa1)
*/
var ExcelFormulas = {
PVIF: function(rate, nper) {
return Math.pow(1 + rate, nper);
},
bind SPACE "+dota_camera_follow; +dota_camera_follow; -dota_camera_follow"
Enter that into the console and space will center with a single tap. It doesn't lock the camera though so I will see if there is a better bind.
edit:
dota_camera_follow_doublepress_time 100
entering this is likely needed to make it work right. Tried some stuff and not sure how to reset it to check if it is strictly necessary.
@jonathantneal
jonathantneal / README.md
Last active March 26, 2025 10:31
Nearest Normal Ratio Calculator

Nearest Normal Aspect Ratio

This function returns the nearest aspect ratio of a width and height within a limited range of possible aspect ratios.

In other words, while 649x360 technically has an aspect ratio of 649:360, it’s often useful to know that the nearest normal aspect ratio is actually 9:5 (648x360).

nearestNormalAspectRatio(width, height, [side], [maxWidth], [maxHeight])
@joshuadavidnelson
joshuadavidnelson / create-image-id.php
Last active November 7, 2023 05:04
Programmatically create the image attachment and return the new media upload id.
<?php
/**
* Create the image attachment and return the new media upload id.
*
* @author Joshua David Nelson, [email protected]
*
* @since 03.29.2017 updated to a class, utilizing code from Takuro Hishikawa's gist linked below.
*
* @see https://gist.github.com/hissy/7352933
*
@leandrotoledo
leandrotoledo / main.py
Last active February 2, 2024 00:08
Webhook using self-signed certificate and Flask (with python-telegram-bot library)
#!/usr/bin/env python
'''Using Webhook and self-signed certificate'''
# This file is an annotated example of a webhook based bot for
# telegram. It does not do anything useful, other than provide a quick
# template for whipping up a testbot. Basically, fill in the CONFIG
# section and run it.
# Dependencies (use pip to install them):
# - python-telegram-bot: https://github.com/leandrotoledo/python-telegram-bot
@mrkpatchaa
mrkpatchaa / git-export-changes-between-two-commits.md
Last active June 17, 2025 09:42
[Git command to export only changed files between two commits] #git

Use case : Imagine we have just created a project with composer create-project awesone-project (currently V0.2). 2 weeks later, there is a new release (V0.3). How to update your project ? Since composer update only updates the project dependencies, it is not what we are looking for. Composer doesn't know about awesome-project since it's not in our composer.json.

After trying many git solutions, I've come to this :

git archive --output=changes.zip HEAD $(git diff --name-only SHA1 SHA2 --diff-filter=ACMRTUXB)

This command will check for changes between the two commits and ignore deleted files.

@opus-x
opus-x / Spotify_Eliminate_Advertisements
Last active July 1, 2025 15:38
Eliminate Spotify Advertisements + Complete Server List
##################################################################################
# ELIMINATE SPOTIFY ADS (VERSION 1.2 - 8.5) - ABANDONED FOR NOW #
##################################################################################
#
# NOTE: SOMETIMES ONLY ANNOUNCEMENT OF AN AD WHILE USING APP VERSION 7.5-7.9?-8.x.
# USING AN OFFICIAL OLDER VERSION SOLVES THIS. TEST IT (APKMIRROR). THIS WILL NOT
# OCCUR USING CHROMECAST / GOOGLE HOME.
#
# COULD NOT SOLVE THE AUDIO AD INRO/OUTRO IN THE APP.
# SUGGESTIONS? WRITE A COMMENT BELOW.
@trapd00r
trapd00r / Extension.pm
Created December 14, 2018 16:50
All the filetypes in the universe
package File::Extension;
use strict;
use Carp ();
use Data::Dumper;
{
package Data::Dumper;
no strict 'vars';
$Terse = $Indent = $Useqq = $Deparse = $Sortkeys = 1;
@kunofellasleep
kunofellasleep / SharedPlayPulse.js
Last active June 26, 2020 10:02
How we shared the small world in Spark AR Hackathon India
// Modules
const Patches = require('Patches');
const Diagnostics = require('Diagnostics');
const Networking = require("Networking");
const R = require('Reactive');
const isDebugLog = false;
const url = "https://team-chrome.firebaseio.com/data.json";