Skip to content

Instantly share code, notes, and snippets.

View jeffvella's full-sized avatar
🏠
Working from home

Jeffrey Vella jeffvella

🏠
Working from home
  • Montréal, Canada
View GitHub Profile
// Extension for System.Type enabling direct access to <summary> contents.
//
// This extension uses DocsByReflection by Jim Blackler:
//
// http://jimblackler.net/blog/?p=49
//
// (this just does the summary for types, but it should be easy to extend this
// concept to include other members and other tags...)
static class DocsByReflectionExtensions
@MarcDiethelm
MarcDiethelm / Contributing.md
Last active September 13, 2024 15:58
How to contribute to a project on Github

This text now lives at https://github.com/MarcDiethelm/contributing/blob/master/README.md. I turned it into a Github repo so you can, you know, contribute to it by making pull requests.


Contributing

If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.

@andyzinsser
andyzinsser / client.m
Last active October 18, 2024 17:15
Full flow of authenticating a Game Center Player on a third party server.
// request Game Center verification data for localPlayer from apple
- (void)authenticateGameCenterPlayer:(GKLocalPlayer *)localPlayer
{
[localPlayer generateIdentityVerificationSignatureWithCompletionHandler:^(NSURL *publicKeyUrl, NSData *signature, NSData *salt, uint64_t timestamp, NSError *error) {
if (error) {
NSLog(@"ERROR: %@", error);
}
else {
// package data to be sent to server for verification
NSDictionary *params = @{@"publicKeyUrl": publicKeyUrl,
@taylorhughes
taylorhughes / gist:4dc50b2fe674c0a84cc6
Created October 29, 2014 00:33
Update Facebook token in iOS client from existing server-side cached token
[self.apiClient retrieveConnectedServicesWithSuccessBlock:^(NSDictionary *services) {
NSArray *facebookTokens = services[@"facebook"];
if (facebookTokens.count == 0) {
return;
}
NSDictionary *mostRecentFacebookTokenDict = facebookTokens[0];
NSNumber *refreshTimeNumber = mostRecentFacebookTokenDict[@"refreshTime"];
NSDate *refreshDate = [NSDate dateWithTimeIntervalSince1970:[refreshTimeNumber doubleValue]];
@HilariousCow
HilariousCow / Vector3Extensions
Last active July 5, 2018 15:21
Just some handy vector3 extensions I use a lot. I like using "FlatY" a lot for games on 2D planes.
using UnityEngine;
using System.Collections;
public static class Vector3Extensions {
public static Vector3 Flattened(this Vector3 vec, Vector3 planeNormal)
{
return Vector3.ProjectOnPlane(vec, planeNormal);
}
@cjddmut
cjddmut / EasingFunctions.cs
Last active November 6, 2024 17:11
Easing Functions for Unity3D
/*
* Created by C.J. Kimberlin
*
* The MIT License (MIT)
*
* Copyright (c) 2019
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@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
{
@MattRix
MattRix / UnityEditorIcons.txt
Last active October 21, 2024 23:36
A list of all the built-in EdtiorGUI icons in Unity. Use EditorGUIUtility.IconContent([icon name]) to access them.
ScriptableObject Icon
_Popup
_Help
Clipboard
SocialNetworks.UDNOpen
SocialNetworks.Tweet
SocialNetworks.FacebookShare
SocialNetworks.LinkedInShare
SocialNetworks.UDNLogo
animationvisibilitytoggleoff
@tomkail
tomkail / ExtendedScriptableObjectDrawer.cs
Last active October 19, 2024 04:37
Displays the fields of a ScriptableObject in the inspector
// Developed by Tom Kail at Inkle
// Released under the MIT Licence as held at https://opensource.org/licenses/MIT
// Must be placed within a folder named "Editor"
using System;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;
@solkar
solkar / ClearShaderCache.cs
Created May 19, 2017 08:52
UnityEditor script to clear shader cache
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
public class ClearShaderCache : MonoBehaviour
{
[MenuItem("Tools/Clear shader cache")]