Skip to content

Instantly share code, notes, and snippets.

@empika
empika / SceneViewEditorBoilerplate.cs
Last active July 17, 2021 02:01
SceneViewEditorBoilerplate
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneViewEditorBoilerplate : ScriptableObject
{
public const string SVE_IS_ENABLED = "SVE_IS_ENABLED";
@empika
empika / AddressablesLoadAllAssets.cs
Created June 25, 2020 15:04
Addressables LoadAllAssets
public IEnumerator LoadAllAssets<T>(OnLoadAssetsCallback<T[]> callback) where T : Object
{
List<IResourceLocation> locations = getLocationsForType<T>();
AsyncOperationHandle<IList<T>> asyncOperation = Addressables.LoadAssetsAsync<T>(locations, null);
yield return asyncOperation;
if (asyncOperation.Status == AsyncOperationStatus.Succeeded)
{
callback(asyncOperation.Result.ToArray());
}
}
public class SetFontPixelly : MonoBehaviour
{
public List<Font> Fonts = new List<Font>();
public void Start()
{
foreach (Font font in Fonts)
{
font.material.mainTexture.filterMode = FilterMode.Point;
}
using System;
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
using UnityEngine.Rendering;
namespace Code.Utils
{
public class MeshUtils

Context

Certain conferences have adapted a "Code of Conduct", all derived from the same text. e.g. http://jsconf.com/codeofconduct.html e.g. https://us.pycon.org/2013/about/code-of-conduct/

While I agree with the intent, I strongly object to the particularly wording, for the following reasons:

  • The only thing it's concerned with is harassment, setting a very negative tone. It suggests that unless warned, monitored and policed, many conference attendees will intimidate, insult, grope and stalk each other. It presumes the worst and treats exceptions as the norm. This does not match the actual experience of attendees at events.
# How to set up your local development machine to use the Apigee Heroku addon
if ENV['APIGEE_TWITTER_API_ENDPOINT']
@@twitter_api = ENV['APIGEE_TWITTER_API_ENDPOINT']
else
# Get this value from Heroku.
# Once you have enabled the addon, boot up the 'heroku console' and run the following:
# puts ENV['APIGEE_TWITTER_API_ENDPOINT']
# this will spit out your correct api endpoint
@@twitter_api = "twitter-api.appXYZABC.apigee.com"
require 'tlsmail'
Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "mydomain.co.uk",
:user_name => "e@mydomain.co.uk",
:password => "password",
def self.fetch_yams
config_path = File.join(RAILS_ROOT, 'config', 'yammer.yml')
yammer = Yammer::Client.new(:config => config_path)
# this is the ID of the main link hashtag (should be 402387)
link_tag_id = 0
tags = yammer.tags
tags.each do |tag|
if( tag.name == "link")
link_tag_id = tag.id
$(".tweet_actions").each(function(ta){
$(this).children().each(function(child){
// cannot call this attach_actions function
attach_actions(this);
});
});
var attach_actions = function(){
console.log("attached action");
}
raw_config = File.read(RAILS_ROOT + "/config/twitter_config.yml")
TWITTER_CONFIG = YAML.load(raw_config)[RAILS_ENV].symbolize_keys