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/[email protected]?module'), import('https://unpkg.com/@tehshrike/[email protected]'), ]).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

@matt-morris
matt-morris / d-any.md
Last active January 8, 2021 16:18
are your dice all the way across the room? i got you....

javascript

// e.g. roll(2).d(8) + roll().d(4) + 11
const roll = (n = 1) => ({
  d: (sides) =>
    Array.from({ length: n }, () => Math.ceil(Math.random() * sides)).reduce(
      (x, y) => x + y,
      0
    ),
})
import Ember from 'ember'
export default Ember.Component.extend({
actions: {
update(key, value) {
this.update(key, value)
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});