Skip to content

Instantly share code, notes, and snippets.

@th3d0g
th3d0g / comment-example.js
Created April 21, 2022 10:49 — forked from brandongoode/comment-example.js
Dynamoose range and hash key example
var commentSchema = new Schema({
postId: {
type: String,
hashKey: true
},
id: {
type: String,
rangeKey: true,
default: shortId.generate
@th3d0g
th3d0g / FileWatcher.cs
Created October 21, 2021 21:32 — forked from elringus/FileWatcher.cs
Allows executing an editor behaviour in response to file modificatons, even when editor application is not in focus.
using System;
using System.Collections.Concurrent;
using System.IO;
using System.Threading.Tasks;
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
/// <summary>
/// Uses file system watcher to track changes to specific files in the project directory.
@th3d0g
th3d0g / BuildDisplayer.cs
Created October 11, 2021 20:57 — forked from llamacademy/BuildDisplayer.cs
Build Incrementor Scripts from https://www.youtube.com/watch?v=PbFE0m9UMtE. If you get value from LlamAcademy, consider becoming a Patreon supporter at https://www.patreon.com/llamacademy
using TMPro;
using UnityEngine;
[RequireComponent(typeof(TextMeshProUGUI))]
public class BuildDisplayer : MonoBehaviour
{
private TextMeshProUGUI Text;
private void Awake()
{
@th3d0g
th3d0g / Events.cs
Created August 12, 2021 20:19 — forked from wmiller/Events.cs
Unity3D Event System
using System.Collections;
using System.Collections.Generic;
public class GameEvent
{
}
public class Events
{
static Events instanceInternal = null;
@th3d0g
th3d0g / multiple_ssh_setting.md
Created April 1, 2019 11:42 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@th3d0g
th3d0g / gist:8067fb45ec6429dd92c554274f4670b2
Created March 6, 2018 01:14 — forked from snowman-repos/gist:3825198
JavaScript: Detect Orientation Change on Mobile Devices
// Listen for orientation changes
window.addEventListener("orientationchange", function() {
// Announce the new orientation number
alert(window.orientation);
}, false);
// Listen for resize changes
window.addEventListener("resize", function() {
// Get screen size (inner/outerWidth, inner/outerHeight)
@th3d0g
th3d0g / mailchimp_listsubscribe.php
Created July 17, 2016 20:08 — forked from anonymous/mailchimp_listsubscribe.php
Mailchimp Subcribe to List PHP
<?php
// Populate using POST vars
$data = [
'email' => '[email protected]',
'status' => 'subscribed'
];
var_dump( syncMailchimp($data) );
@th3d0g
th3d0g / functions.php
Created November 6, 2015 00:15 — forked from jameskoster/functions.php
WooCommerce - Exclude products from a particular category on the shop page
add_action( 'pre_get_posts', 'custom_pre_get_posts_query' );
function custom_pre_get_posts_query( $q ) {
if ( ! $q->is_main_query() ) return;
if ( ! $q->is_post_type_archive() ) return;
if ( ! is_admin() && is_shop() ) {
$q->set( 'tax_query', array(array(
@th3d0g
th3d0g / gist:6cd57c6d0badc5772480
Last active October 19, 2015 21:30 — forked from anonymous/gist:5f401192b236f8daaf1c
Sensei - Tag Courses
// Sensei - Add tags to Courses
// Run this after "register_post_type( 'course'..." in "class-woothemes-sensei-posttypes.php"
register_taxonomy(
'course_tag',
'course',
array(
'hierarchical' => false,
'label' => __( 'Tags', CURRENT_THEME ),
'singular_name' => __( 'Tag', CURRENT_THEME ),
package nl.stroep.games.components;
import flambe.Component;
import nape.space.Space;
/**
* @author Mark Knol [blog.stroep.nl]
*/
class NapeDebugView extends Component
{
private var _space:Space;