Skip to content

Instantly share code, notes, and snippets.

@matt-morris
matt-morris / README.md
Created May 22, 2023 03:03 — forked from j-mai/README.md
A guide for using Unity and Git

Using Git with Unity

What are the problems?

  • Noise: Unity editor has lots of temporary files that we don’t want git to track
  • Broken object references: Unity keeps track of objects created by using random GUIDs, and if they aren’t tracked using .meta files then there can be conflicts that really break your project
  • Unresolvable merge conflicts: files like scene files that are written in confusing languages (like YAML) that are supposed to be translations of Unity editor actions into code. Most likely, you cannot resolve using Git, and the only way to resolve merge conflicts is to open it in a text editor and resolve them manually while hoping you don't mess anything up because these files are confusing and not meant to be manipulated directly.
  • Large files: Sometimes assets are large and take up a lot of storage space

💻 Project Setup

@matt-morris
matt-morris / iphone-text-message-sqlite.sql
Created April 9, 2023 01:44 — forked from aaronhoffman/iphone-text-message-sqlite.sql
SQLite SQL Query for iPhone Text Message Backup
-- more info http://aaron-hoffman.blogspot.com/2017/02/iphone-text-message-sqlite-sql-query.html
select
m.rowid
,coalesce(m.cache_roomnames, h.id) ThreadId
,m.is_from_me IsFromMe
,case when m.is_from_me = 1 then m.account
else h.id end as FromPhoneNumber
,case when m.is_from_me = 0 then m.account
else coalesce(h2.id, h.id) end as ToPhoneNumber
,m.service Service
@matt-morris
matt-morris / pg_pub_sub.rb
Created March 30, 2023 16:31 — forked from chsh/pg_pub_sub.rb
PostgreSQL LISTEN/NOTIFY example for ruby
#
# A:
# pubsub = PgPubSub.new('channelname')
# pubsub.subscribe do |data|
# puts "data: #{data} is coming!"
# end
#
# B:
# pubsub = PgPubSub.new('channelname')
# pubsub.publish("hello world")
@matt-morris
matt-morris / obsidian-web-clipper.js
Created July 21, 2022 17:54 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@matt-morris
matt-morris / Heading.tsx
Created April 8, 2022 02:25 — forked from ryonakae/Heading.tsx
Custom Polymorphic Component by Framer Motion with TypeScript
import { HTMLMotionProps, motion } from 'framer-motion'
import { forwardRef, ReactNode } from 'react'
type HeadingTags = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
type HeadingProps = {
as: HeadingTags
children: ReactNode
}
const CustomTagComponent = forwardRef<HTMLHeadingElement, HeadingProps>(
@matt-morris
matt-morris / README.md
Created June 18, 2021 16:01 — forked from benknight/README.md
[use-carousel] Headless UI React hook for building a scroll-based carousel

[use-carousel] Headless UI React hook for building a scroll-based carousel

BYO-UI. No CSS necessary. Inspired by react-table.

Usage:

const {
  getLeftNavProps,
 getRightNavProps,
@matt-morris
matt-morris / README.MD
Created June 9, 2021 14:53 — forked from ShinyChang/README.MD
Codesandbox sublime keymap
  1. Create new sandbox on codesandbox
  2. Press Cmd+Shift+P and choose >Preferences: Open Keyboard Shortcuts (JSON)
  3. Paste the text of keybindings.json in the opened tab (keybindings.json)

The key bindings will store in the user preference, which means you don't need set it again in the future.

Keymap source: https://github.com/Microsoft/vscode-sublime-keybindings

import Ember from 'ember'
export default Ember.Component.extend({
actions: {
update(key, value) {
this.update(key, value)
}
}
});
@matt-morris
matt-morris / editHierNode.html
Created February 6, 2019 22:18 — forked from rbelew/editHierNode.html
editHierNode: adding and editing nodes in d3.hierarchy
<!DOCTYPE html>
<!-- https://bl.ocks.org/mbostock/1093025 -->
<meta charset="utf-8">
<style>
.node rect {
cursor: pointer;
fill: #fff;
@matt-morris
matt-morris / README.md
Created July 25, 2018 17:25 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe