Skip to content

Instantly share code, notes, and snippets.

@denji
denji / http-benchmark.md
Last active May 9, 2024 13:04
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)
@m33x
m33x / hass.js
Last active May 9, 2024 13:03
Simple Home Assistant (HASS) iOS Widget via Scriptable App
let widget = await createWidget();
if (!config.runsInWidget) {
await widget.presentSmall();
}
Script.setWidget(widget);
Script.complete();
async function createWidget(items) {
<?xml version="1.0" encoding="UTF-8"?>
<!--
- This logger config is copied from https://gist.github.com/Minecrell/e85abdaf419fa3636c55848cf0ca2e1b
-
- To use this file, add this to JVM args: -Dlog4j.configurationFile=log4j2.xml
-
- For more information, see
- https://logging.apache.org/log4j/2.0/manual/filters.html
-->
@rabeeaali
rabeeaali / DateConverter.php
Last active May 9, 2024 13:00
Convert Date From Hijri to Gregorian And vice versa
<?php
namespace App\Services;
class DateConverter
{
public static $Day;
public static $Month;
public static $Year;
@luckman212
luckman212 / icloud_ubiquity_fix.sh
Created October 9, 2023 17:28
Fix for stuck iCloud Ubiquity containers reported as Client Truth Client Truth Unclean Items
#!/usr/bin/env bash
CLIENT_DB="$HOME/Library/Application Support/CloudDocs/session/db/client.db"
[[ -e $CLIENT_DB ]] || { echo "db not found"; exit 1; }
mapfile -t ITEM_IDS < <(sqlite3 "$CLIENT_DB" <<-EOS
SELECT throttle_id
FROM client_sync_up
EOS
)
@caniszczyk
caniszczyk / clone-all-twitter-github-repos.sh
Created October 9, 2012 04:25
Clone all repos from a GitHub organization
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
@d7samurai
d7samurai / .readme.md
Last active May 9, 2024 12:59
Minimal D3D11 sprite renderer NEO

sponsored by SuperNeo copy 4

Minimal D3D11 sprite renderer NEO

Ultra-compact sprite rendering code with example frame animation logic. This release contains tech bits from the upcoming SuperNeo™ 2D game engine and includes rotation, anchor/pivot point, color filtering, alpha blending and built-in antialiased point sampling. As usual: complete, runnable single-function app. ~150 LOC. No modern C++, OOP or (other) obscuring cruft.

Minimal D3D11 sprite renderer NEO 1337

Sprites are rendered back-to-front (AKA "painter's algorithm") in the order they are submitted, as one draw call. The provided setup employs a single texture atlas containing all the sprite graphics.

The renderer is "im

@KartikTalwar
KartikTalwar / Documentation.md
Last active May 9, 2024 12:59
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@matthewzring
matthewzring / markdown-text-101.md
Last active May 9, 2024 12:58
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@yamaya
yamaya / xcode-swift-vers
Last active May 9, 2024 12:57
Xcode swift version record
# Xcode 6.2 (6C131e)
Swift version 1.1 (swift-600.0.57.4)
Target: x86_64-apple-darwin14.1.0
# Xcode 6.3 (6D570)
Apple Swift version 1.2 (swiftlang-602.0.49.3 clang-clang-602.0.49)
Target: x86_64-apple-darwin14.1.0
# Xcode 6.3.1 (6D1002)
Apple Swift version 1.2 (swiftlang-602.0.49.6 clang-602.0.49)