Skip to content

Instantly share code, notes, and snippets.

@umer936
umer936 / main.js
Last active July 13, 2020 15:42
Javascript bookmarklet to strip tracking tags in URLs for better bookmarking
javascript: void
function() {
var url = location.search;
if (url) {
var each = url.slice(1).split("&");
console.log("Stripping query parameters:", each);
var leave = each.filter(function(url) {
return "utm_" !== url.substr(0, 4) &&
"mc_" !== url.substr(0, 3) &&
"ct" !== url.substr(0, 2) &&
@umer936
umer936 / screen-rotation.sh
Created February 4, 2019 03:46
Grab accelerometer data from laptop
#! /bin/bash
/usr/bin/cat /sys/bus/iio/devices/iio\:device3/in_accel_x_raw
@umer936
umer936 / fetch_wrapper.js
Last active May 22, 2023 16:30 — forked from Billcountry/LICENSE.md
A wrapper for fetch that takes jQuery ajax type setup
/**
* @umer936, umer936/ajaxFetchWrapper.js
* https://gist.github.com/umer936/c6bdbd80b8620dea5dfe7eac5e57b000
* modified from: Billcountry/fetch_wrapper.js
*
* @param options Object of options:
{
beforeSend (function): null,
url (string): "",
type (string): if data => "POST", otherwise "GET",
@umer936
umer936 / delete_dups.ps
Created August 28, 2023 23:42
Powershell empty/duplicate finder/remover
ls *.* -recurse | get-filehash | group -property hash | where { $_.count -gt 1 } | % { $_.group | select -skip 1 } | del
# https://n3wjack.net/2015/04/06/find-and-delete-duplicate-files-with-just-powershell/
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
const logActions = false;
class UpdateUserIds extends AbstractMigration
{
@umer936
umer936 / HTMLtoPHPWord.php
Created May 19, 2025 17:13
HTML to PHPWord
<?php
declare(strict_types=1);
/**
* Writes a Word document of abstracts
*
* @param string $path The path to the Word document
* @param int|null $conference_id
* @return bool Whether the write was successful
* @throws \PhpOffice\PhpWord\Exception\Exception