Skip to content

Instantly share code, notes, and snippets.

View tylorr's full-sized avatar

Tylor Reynolds tylorr

View GitHub Profile
@unpacklo
unpacklo / gist:f4af1d688237a7d367f9
Last active April 12, 2018 04:35
imgui drag reordering
void **editResources = gui->editResources;
float itemHeight = ImGui::GetTextLineHeightWithSpacing();
int displayStart = 0, displayEnd = gui->numEditResources;
int listItemHovered = -1;
ImGui::CalcListClipping(gui->numEditResources, itemHeight, &displayStart, &displayEnd);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + (displayStart * itemHeight));
ImVec4 dirtyColor(1.0f, 0.5f, 0.5f, 1.0f), normalColor(1.0f, 1.0f, 1.0f, 1.0f);
@chrismdp
chrismdp / s3.sh
Last active May 5, 2026 04:47
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@f1sherman
f1sherman / forwarding-example.md
Last active March 12, 2021 00:21
Port Forwarding Example in OS X El Capitan

Add the following to /etc/pf.anchors/myname:

rdr pass on lo0 inet proto tcp from any to any port 80 -> 127.0.0.1 port 4000
rdr pass on lo0 inet proto tcp from any to any port 443 -> 127.0.0.1 port 4001

Add the following to /etc/pf-myname.conf:

rdr-anchor "forwarding"
load anchor "forwarding" from "/etc/pf.anchors/myname"
@t0chas
t0chas / CustomEditorBase.cs
Last active September 2, 2024 06:54
Default Custom Inspector-Editor for Unity3D with ReorderableLists for arrays handling
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Collections.Generic;
using UnityEditor.AnimatedValues;
[CustomEditor(typeof(UnityEngine.Object), true, isFallback = true)]
[CanEditMultipleObjects]
public class CustomEditorBase : Editor
{
@knowbody
knowbody / RNfontWeights.js
Created July 14, 2016 13:42
React Native Font Weight Cheatsheet iOS
{ fontWeight: '100' }, // Thin
{ fontWeight: '200' }, // Ultra Light
{ fontWeight: '300' }, // Light
{ fontWeight: '400' }, // Regular
{ fontWeight: '500' }, // Medium
{ fontWeight: '600' }, // Semibold
{ fontWeight: '700' }, // Bold
{ fontWeight: '800' }, // Heavy
{ fontWeight: '900' }, // Black
@taka-oyama
taka-oyama / ExitPlayModeOnScriptCompile.cs
Created October 5, 2016 02:11
This script exits play mode whenever script compilation is detected during an editor update.
// Copyright Cape Guy Ltd. 2015. http://capeguy.co.uk.
// Provided under the terms of the MIT license -
// http://opensource.org/licenses/MIT. Cape Guy accepts
// no responsibility for any damages, financial or otherwise,
// incurred as a result of using this code.
using UnityEngine;
using UnityEditor;
/// <summary>
@devmrin
devmrin / TouchableDebounce.js
Last active June 4, 2019 20:22
Touchable Debounce - Medium Article
import React, { PureComponent } from "react";
import { PropTypes, ViewPropTypes, TouchableOpacity } from "react-native";
import { debounce } from "underscore";
//PureComponent handles shouldComponentUpdate for you.
class TouchableDebounce extends React.PureComponent {
constructor(props) {
super(props);
}
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#define PROFILING_ENABLED
#endif
#if NET_4_6 || NET_STANDARD_2_0 || NETFX_CORE
#define NET_MODERN
#endif
using System;
using System.Diagnostics;
@DimitryDushkin
DimitryDushkin / configs.js
Created October 2, 2018 14:19
React Native 0.57 + Babel 7 + Typescript + Jest
// babel.config.js
module.exports = {
"presets": [
"module:metro-react-native-babel-preset",
],
"plugins": [
["module-resolver", {
"root": ["./src"],
"extensions": [".js", ".ts", ".tsx", ".ios.js", ".android.js"]
}],
@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)