Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<document>
<steps>
<wait>5</wait>
<press>SkipIntro</press>
<wait>3</wait>
<press>Menu/Settings</press>
<wait>3</wait>
<press>SettingsTab/Options</press>
@mandarinx
mandarinx / ScrollRectAutoScroll.cs
Created August 22, 2017 11:30 — forked from QubitsDev/ScrollRectAutoScroll.cs
Unity3d ScrollRect Auto-Scroll, Dropdown Use: Places this component in the Template of Dropdown (with the ScrollRect component)
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
[RequireComponent(typeof(ScrollRect))]
public class ScrollRectAutoScroll : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
public float scrollSpeed = 10f;
private bool mouseOver = false;
@sdrew
sdrew / Procfile
Last active July 27, 2021 15:25
Laravel configs for Heroku/Dokku
web: vendor/bin/heroku-php-apache2 public/
@ryanermita
ryanermita / rails_locking.md
Last active February 17, 2024 02:19
Optimistic and Pessimistic Locking in Rails

Optimistic Locking assumes that a database transaction conflict is very rare to happen. It uses a version number of the record to track the changes. It raise an error when other user tries to update the record while it is lock.

usage

Just add a lock_version column to the table you want to place the lock and Rails will automatically check this column before updating the record.

Pessimistic locking assumes that database transaction conflict is very likely to happen. It locks the record until the transaction is done. If the record is currently lock and the other user make a transaction, that second transaction will wait until the lock in first transaction is release.

usage

using UnityEngine;
using System.Collections;
using UnityEngine.Events;
namespace Cluster {
public class CollisionCall : MonoBehaviour {
public LayerMask layerMask = -1;
@jaydenseric
jaydenseric / ffmpeg-web-video-guide.md
Last active February 17, 2024 23:49
A quick guide to using FFmpeg to create cross-device web videos.

Video conversion with FFmpeg

Install

On mac:

  1. Download the latest release.
  2. Extract the binary and place it in /usr/local/bin.

Command basics

@Vestride
Vestride / encoding-video.md
Last active March 12, 2024 16:41
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@timofei7
timofei7 / Singleton.cs
Last active October 1, 2022 10:06
unity3d c# singleton class with automatic prefab loading
using UnityEngine;
using System.Collections;
using System;
/// <summary>
/// Prefab attribute. Use this on child classes
/// to define if they have a prefab associated or not
/// By default will attempt to load a prefab
/// that has the same name as the class,
/// otherwise [Prefab("path/to/prefab")]
@smpallen99
smpallen99 / application.html.eex
Last active April 17, 2017 13:12
Phoenix content_for prototype
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Hello Phoenix!</title>
@brianhempel
brianhempel / enumerator_to_json.rb
Created February 17, 2015 17:32
Lazily convert an Enumerator or Enumerator::Lazy to a JSON array. Save as config/initializers/enumerator_to_json.rb
# Natively, Enumerators get JSONized like "#<Enumerator::Lazy:0x007f8714807080>", or they explode, either of which is a problem.
# We want them to make an array, and do it lazily so we don't have to keep the items in memory!
class Enumerator
def to_json(state)
state.depth += 1
string = "[\n"
first_item = true
self.each do |item|