Skip to content

Instantly share code, notes, and snippets.

View PixelPartner's full-sized avatar
💭
Who wants his products configured directly in AR?

Thomas Kumlehn PixelPartner

💭
Who wants his products configured directly in AR?
View GitHub Profile

1. Download your Twitter archive

You can find this feature in Settings > Download Twitter Archive. It might take 24 hours to receive. Unzip the file and open the data folder in your terminal:

cd ~/Downloads/twitter-archive-zip-you-downloaded/data

(I have seen reports that this function may no longer be working, so this guide is mostly useful to those who were lucky enough to already have downloaded their archive.)

// A URLSession extension that fetches data from a URL and decodes to some Decodable type.
// Usage: let user = try await URLSession.shared.decode(UserData.self, from: someURL)
// Note: this requires Swift 5.5.
extension URLSession {
func decode<T: Decodable>(
_ type: T.Type = T.self,
from url: URL,
keyDecodingStrategy: JSONDecoder.KeyDecodingStrategy = .useDefaultKeys,
dataDecodingStrategy: JSONDecoder.DataDecodingStrategy = .deferredToData,
dateDecodingStrategy: JSONDecoder.DateDecodingStrategy = .deferredToDate
@steipete
steipete / View.swift
Created April 4, 2021 13:43
Accept dropping a file onto SwiftUI (both iOS and macOS)
.onDrop(of: [.fileURL], isTargeted: nil) { providers in
if let loadableProvider = providers.first(where: { $0.canLoadObject(ofClass: URL.self) }) {
_ = loadableProvider.loadObject(ofClass: URL.self) { fileURL, _ in
if let fileURL = fileURL, fileURL.pathExtension.lowercased() == "zip" {
self.logger.info("Dropped \(fileURL.path)")
DispatchQueue.main.async {
importer.open(zipArchiveURL: fileURL)
}
}
}
@luislobo14rap
luislobo14rap / is.js (only for detect chrome in mac and ios).js
Created September 15, 2020 15:25
is.js (only for detect chrome in mac and ios).js
/*!
* is.js 0.9.0
* Author: Aras Atasaygin. Adapted by Luis Lobo
*/
// define 'is' object and current version
let is = {};
is.VERSION = '0.9.0';
// store navigator properties to use later
@ursi
ursi / ellie-init.user.js
Last active March 12, 2020 11:01
Set Ellie's initial text
// ==UserScript==
// @name Ellie Init
// @namespace http://tampermonkey.net/
// @version 1.0.0
// @description Set Ellie's initial text
// @author Mason Mackaman
// @match https://ellie-app.com/new
// @grant none
// ==/UserScript==
@yosun
yosun / usdz.md
Last active February 4, 2024 01:53
usdz cheatsheet

Notes on https://developer.apple.com/videos/play/wwdc2019/602/

USDZ archive

USDZ is an archive consisting of scene files (usda, usdc, usd) and textures (png/jpg)

  • usda: human readable file (A)
  • usdc: binary computer file (C)
  • usd: both?

apple usd helper python scripts

@opsb
opsb / Cursor.elm
Last active February 14, 2022 00:26
elm-ui cursor
module Cursor exposing (cursor, Cursor(..))
import Element exposing (Element, Attribute, htmlAttribute)
import Html.Attributes
cursor : Cursor -> Attribute msg
cursor cursor_ =
htmlAttribute <| Html.Attributes.style "cursor" (cursorName cursor_)
@zicklag
zicklag / CharacterController2.hx
Last active May 21, 2020 05:48
A WIP Armory3D Character Controller
package arm;
import kha.graphics4.hxsl.Types.Vec;
import kha.FastFloat;
import iron.math.Quat;
import iron.math.Vec4;
import haxe.Log;
import armory.trait.physics.PhysicsWorld;
import iron.system.Input;
import armory.trait.physics.bullet.RigidBody;
@warrenm
warrenm / ARQLThumbnailGenerator.swift
Created June 12, 2018 06:31
Generating thumbnail images of 3D model files for use with AR QuickLook
import Foundation
import SceneKit
class ARQLThumbnailGenerator {
private let device = MTLCreateSystemDefaultDevice()!
/// Create a thumbnail image of the asset with the specified URL at the specified
/// animation time. Supports loading of .scn, .usd, .usdz, .obj, and .abc files,
/// and other formats supported by ModelIO.
@gergely-marko
gergely-marko / Report.elm
Created March 6, 2018 07:00
General report helper functions
module Report exposing (..)
import Date exposing (Date)
import Helpers
import Html.String as Html exposing (Html, b, br, div, h1, h2, h3, img, table, td, text, th, tr)
import Html.String.Attributes exposing (..)
import Localization
import Location exposing (Location)
import Position exposing (Position)
import Project exposing (Project)