Skip to content

Instantly share code, notes, and snippets.

View msp's full-sized avatar

Matt Spendlove msp

View GitHub Profile
@TehBrian
TehBrian / final-cut-pro-trial-reset.sh
Created June 21, 2022 19:33
Final Cut Pro Trial Reset
mv -v ~/Library/Application\ Support/.ffuserdata ~/.Trash
@JamesYang76
JamesYang76 / Time Zone.md
Last active April 4, 2024 22:00
Time Zone for rails

Time zones

There are trhee diffrent time zones in rails

  • System - The server time zone
  • Application - Rails application use own time zone
  • Database - Default is UTC, but do not change it

Cautions

  • config.time_zone should be set when an app dose not support multiple time zones
  • Do not use Date/Time API using system time zone
  • Date could be incorrect by being converted from datetime or time to date
@jarmitage
jarmitage / tidal-multi-stream.hs
Created October 5, 2019 23:31
Multiple Tidal streams to multiple OSCTargets
-- https://tidalcycles.org/index.php/Custom_OSC
:set -XOverloadedStrings
:set prompt ""
:set prompt-cont ""
import Sound.Tidal.Context
superDirt <- startTidal (superdirtTarget {oLatency = 0.1, oAddress = "127.0.0.1", oPort = 57120}) (defaultConfig {cFrameTimespan = 1/20})
@jarmitage
jarmitage / default-effects-extra.tidal
Created April 25, 2019 10:43
Tidal file for playing with new SuperDirt FX
-- New SuperDirt effects in Tidal 1.0.11
-- https://github.com/musikinformatik/SuperDirt/blob/develop/library/default-effects-extra.scd
-- https://github.com/tidalcycles/Tidal/blob/master/src/Sound/Tidal/Params.hs
let p = s "arpy*4"
{-
Waveloss
Divides an audio stream into tiny segments, using the signal's
zero-crossings as segment boundaries, and discards a fraction of them.
@dvergeylen
dvergeylen / README.md
Last active April 3, 2024 16:27
JSQrcode library tutorial

Introduction

This tutorial is a step by step guide on how to use the javascript QR Code scanner on a webcam video stream in browser. Some people reported experiencing problems including it in their own projets so I guess a tutorial might help others.

Step 1: Include library in <head> section

<html lang="en">
  <head>
    <script type="text/javascript" src="grid.js"></script>
    <script type="text/javascript" src="version.js"></script>
    <script type="text/javascript" src="detector.js"></script>
@Demkeys
Demkeys / MuteTimelineTracksScript.cs
Created June 29, 2018 13:59
Example code showing how to mute Tracks in a Timeline asset.
/// <summary>
/// Instructions
/// - Create a Timeline asset. Add 3 tracks to it.
/// - Create empty GameObject in scene. Attach this script to the GameObject. Then attach a PlayableDirector component to it.
/// Drag and drop the Timeline asset you created into the Playable field of the PlayableDirector.
/// - Hit Play. The 1, 2 and 3 keys on your keyboard mute the first, second and third tracks respectively.
/// </summary>
using System.Collections;
using System.Collections.Generic;
@dannote
dannote / final-cut-pro-trial-reset.swift
Last active April 17, 2024 10:39
Final Cut Pro X trial reset
#!/usr/bin/swift
import Foundation
let path = URL(fileURLWithPath: NSString(string: "~/Library/Application Support/.ffuserdata").expandingTildeInPath)
let data = try! NSData(contentsOf: path) as Data
let dictionary = try! NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data) as! NSDictionary
let mutableDictionary = dictionary.mutableCopy() as! NSMutableDictionary
for (key, value) in mutableDictionary {
@serradura
serradura / firebase_admin.rb
Last active February 10, 2022 18:45
FirebaseAdmin::Auth.verify_id_token | Ruby solution for https://firebase.google.com/docs/auth/admin/verify-id-tokens
# Usage:
# ========
# FirebaseAdmin::Auth.verify_id_token(your_id_token)
#
# The method call follows the same API of the Node.js, JAVA and Python SDKs.
# See https://firebase.google.com/docs/auth/admin/verify-id-tokens#verify_id_tokens_using_the_firebase_admin_sdk
# Dependencies:
# ---------------
# gem 'activesupport'
@gunderson
gunderson / FlyCamera.cs
Last active January 15, 2024 16:31
Unity Script to give camera WASD + mouse control
using UnityEngine;
using System.Collections;
public class FlyCamera : MonoBehaviour {
/*
Writen by Windexglow 11-13-10. Use it, edit it, steal it I don't care.
Converted to C# 27-02-13 - no credit wanted.
Simple flycam I made, since I couldn't find any others made public.
Made simple to use (drag and drop, done) for regular keyboard layout
@jsonberry
jsonberry / onload.js
Last active July 3, 2023 14:10
Window vs. Document Loading Events
/**
Taken from: http://stackoverflow.com/questions/588040/window-onload-vs-document-onload
According to Parsing HTML documents - The end,
The browser parses the HTML source and runs deferred scripts.
A DOMContentLoaded is dispatched at the document when all the HTML has been parsed and have run. The event bubbles to the window.
The browser loads resources (like images) that delay the load event.
A load event is dispatched at the window.
Therefore, the order of execution will be
DOMContentLoaded event listeners of window in the capture phase
DOMContentLoaded event listeners of document